Initial commit
This commit is contained in:
commit
5825c5706d
4 changed files with 42 additions and 0 deletions
18
tasks/main.yml
Normal file
18
tasks/main.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: check if the config already exists
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/caddy/sites-enabled/{{ instance_name | default(ansible_play_name) }}"
|
||||
get_mime: false
|
||||
get_checksum: false
|
||||
get_attributes: false
|
||||
when: onlyifnotexist is defined and onlyifnotexist
|
||||
register: cnf
|
||||
|
||||
- name: configure caddy for {{ instance_name | default(ansible_play_name) }}
|
||||
template:
|
||||
src: caddy.j2
|
||||
dest: "/etc/caddy/sites-enabled/{{ instance_name | default(ansible_play_name) }}"
|
||||
mode: 0644
|
||||
when: onlyifnotexist is not defined or not onlyifnotexist or not cnf.stat.exists
|
||||
notify:
|
||||
- reload caddy
|
||||
Loading…
Add table
Add a link
Reference in a new issue