diff --git a/update-cloudflace-tunnel.yaml b/update-cloudflace-tunnel.yaml new file mode 100644 index 0000000..3d1fb6e --- /dev/null +++ b/update-cloudflace-tunnel.yaml @@ -0,0 +1,28 @@ +--- +- name: Update cloud Flare Tunnel + hosts: cloudflare-tunnel.ki5bhv.com + + tasks: + - name: Pull the newest package + ansible.builtin.command: + cmd: "curl --location --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb" + + - name: installing package + become: true + ansible.builtin.command: + cmd: "dpkg -i cloudflared.deb" + + - name: Restart the service + become: true + ansible.builtin.command: + cmd: "systemctl restart cloudflared.service" + + - name: check before cleanup + ansible.builtin.stat: + path: cloudflared.deb + register: cloudflared-file + + - name: Cleanup + when: cloudflared-file.stat.exists + ansible.builtin.command: + cmd: "rm cloudflared.deb" \ No newline at end of file