You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
975 B
42 lines
975 B
2 years ago
|
- name: install caddy from debian/ubuntu repository
|
||
|
block:
|
||
|
- name: install dependencies
|
||
|
package:
|
||
|
name:
|
||
|
- debian-keyring
|
||
|
- debian-archive-keyring
|
||
|
- apt-transport-https
|
||
|
|
||
|
|
||
|
- name: get caddy signing key location
|
||
|
set_fact:
|
||
|
caddy_signing_key_file: "{{ (gpg_keyrings_dir, 'caddy.asc') | path_join }}"
|
||
|
|
||
|
|
||
|
- name: add caddy signing key
|
||
|
get_url:
|
||
|
url: "{{ caddy_gpg_key_url }}"
|
||
|
dest: "{{ caddy_signing_key_file }}"
|
||
|
mode: a+r
|
||
|
|
||
|
|
||
|
- name: add apt repo
|
||
|
apt_repository:
|
||
|
repo: "deb [signed-by={{ caddy_signing_key_file | quote }}] {{ caddy_repo_url }} any-version main"
|
||
|
register: result
|
||
|
|
||
|
|
||
|
- name: update repository index
|
||
|
apt:
|
||
|
force_apt_get: yes
|
||
|
update_cache: yes
|
||
|
changed_when: no
|
||
|
when: result.changed
|
||
|
|
||
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||
|
|
||
|
|
||
|
- name: install caddy
|
||
|
package:
|
||
|
name: caddy
|