summaryrefslogtreecommitdiffstats
path: root/roles/cloudflared/tasks/install-alpine.yml
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-07-19 00:43:51 +0200
committerAhmed Abdelhalim <[email protected]>2026-07-19 00:46:29 +0200
commit43034bba4574f03c5d88f4380767c40e64d60c6e (patch)
treec3e2b0b171792e494bd42b032c5f3529f3697d24 /roles/cloudflared/tasks/install-alpine.yml
parent457ea6648783258458bb12280d39d5816450ff62 (diff)
Refactor and clean up code
Diffstat (limited to 'roles/cloudflared/tasks/install-alpine.yml')
-rw-r--r--roles/cloudflared/tasks/install-alpine.yml28
1 files changed, 18 insertions, 10 deletions
diff --git a/roles/cloudflared/tasks/install-alpine.yml b/roles/cloudflared/tasks/install-alpine.yml
index 28437fc9..d828d0b6 100644
--- a/roles/cloudflared/tasks/install-alpine.yml
+++ b/roles/cloudflared/tasks/install-alpine.yml
@@ -1,18 +1,26 @@
---
-- name: "Check if cloudflared binary exists"
- ansible.builtin.stat:
- path: "/usr/local/bin/cloudflared"
- register: cloudflared_binary
-
-- name: "Download cloudflared binary"
+- name: "Add Cloudflare APK repo key"
become: true
ansible.builtin.get_url:
- url: "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64"
- dest: "/usr/local/bin/cloudflared"
- mode: "0755"
+ url: "https://pkg.cloudflare.com/cloudflare-main.pub"
+ dest: "/etc/apk/keys/cloudflare-main.pub"
+ mode: "0644"
owner: "root"
group: "root"
- when: not cloudflared_binary.stat.exists
+
+- name: "Add Cloudflare APK repository"
+ become: true
+ ansible.builtin.lineinfile:
+ path: "/etc/apk/repositories"
+ line: "https://pkg.cloudflare.com/cloudflared/apk"
+ state: present
+
+- name: "Install cloudflared"
+ become: true
+ ansible.builtin.package:
+ name: "cloudflared"
+ state: present
+ update_cache: true
- name: "Deploy cloudflared OpenRC service"
become: true