infrastructure/ansible/roles/docker/tasks/theorangeone.net.yml
2020-04-10 11:31:01 +01:00

29 lines
785 B
YAML

- name: Create theorangeone.net directory
file:
path: /opt/theorangeone.net
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install theorangeone.net compose file
template:
src: files/theorangeone.net/docker-compose.yml
dest: /opt/theorangeone.net/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: /usr/bin/docker-compose -f %s config
register: compose_file
become: true
- name: Cycle theorangeone.net container
docker_compose:
project_src: /opt/theorangeone.net
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
when: compose_file.changed
loop:
- absent
- present