summaryrefslogtreecommitdiffstats
path: root/roles/caddy/tasks/install-debian.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/caddy/tasks/install-debian.yml')
-rw-r--r--roles/caddy/tasks/install-debian.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/roles/caddy/tasks/install-debian.yml b/roles/caddy/tasks/install-debian.yml
new file mode 100644
index 00000000..710c9e90
--- /dev/null
+++ b/roles/caddy/tasks/install-debian.yml
@@ -0,0 +1,24 @@
+---
+- name: "Download Caddy GPG key"
+ become: true
+ ansible.builtin.get_url:
+ url: "https://dl.cloudsmith.io/public/caddy/stable/gpg.key"
+ dest: "/etc/apt/trusted.gpg.d/caddy-stable.asc"
+ mode: "0644"
+ owner: "root"
+ group: "root"
+
+- name: "Add Caddy APT repository"
+ become: true
+ ansible.builtin.apt_repository:
+ # yamllint disable-line rule:line-length
+ repo: "deb [signed-by=/etc/apt/trusted.gpg.d/caddy-stable.asc] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main"
+ state: "present"
+ filename: "caddy-stable"
+
+- name: "Install caddy"
+ become: true
+ ansible.builtin.package:
+ name: "caddy"
+ state: "present"
+ update_cache: true