[WHOAMI] Migrate configs

This commit is contained in:
Florian RICHER 2023-05-20 16:06:45 +02:00
parent db6cdfae3b
commit 709466ef51
4 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,32 @@
---
- name: Check whoami directory exist
ansible.builtin.file:
path: whoami
state: directory
- name: Copy template conf
ansible.builtin.template:
backup: true
src: "{{ item.src }}"
dest: "whoami/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
register: whoami_copy_templates_results
- name: Force update and restart container
community.docker.docker_compose:
project_src: whoami
state: present
pull: true
restarted: true
when: whoami_copy_templates_results.changed
become: true
- name: Update or start container
community.docker.docker_compose:
project_src: whoami
state: present
pull: true
when: not whoami_copy_templates_results.changed
become: true

View file

@ -0,0 +1,4 @@
---
- ansible.builtin.import_tasks: base.yml
name: base