LabSetup/roles/dock-cfddns/tasks/main.yml

29 lines
740 B
YAML
Raw Normal View History

2020-07-21 03:26:02 +02:00
- name: Create cfddns directory
file:
path: "{{ appdata_path }}/cfddns"
state: directory
owner: "{{ main_username }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install cfddns compose file
template:
src: files/docker-compose.yml
dest: "{{ appdata_path }}/cfddns/docker-compose.yml"
mode: "{{ docker_compose_file_mask }}"
owner: "{{ main_username }}"
validate: docker-compose -f %s config
register: compose_file
become: true
- name: Cycle cfddns container
docker_compose:
project_src: "{{ appdata_path }}/cfddns"
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
when: compose_file.changed
loop:
- absent
- present