2023-12-30 15:22:18 +01:00
|
|
|
- name: "backup docker-compose.yml if it exists"
|
|
|
|
command: >
|
|
|
|
mv "{{ docker_compose_file_path }}" "{{ docker_compose_backup_path }}"
|
|
|
|
args:
|
|
|
|
removes: "{{ docker_compose_file_path }}"
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: checkout repository
|
|
|
|
ansible.builtin.shell: git checkout .
|
|
|
|
become: true
|
|
|
|
args:
|
|
|
|
chdir: "{{docker_compose_instance_directory}}"
|
2024-01-05 11:08:09 +01:00
|
|
|
ignore_errors: true
|
2023-12-30 15:22:18 +01:00
|
|
|
|
|
|
|
- name: pull docker repository
|
|
|
|
git:
|
|
|
|
repo: "{{ repository_address }}"
|
|
|
|
dest: "{{ repository_directory }}"
|
|
|
|
update: yes
|
|
|
|
notify: docker compose project setup
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: "restore docker-compose.yml from backup"
|
|
|
|
command: >
|
|
|
|
mv "{{ docker_compose_backup_path }}" "{{ docker_compose_file_path }}"
|
|
|
|
args:
|
|
|
|
removes: "{{ docker_compose_backup_path }}"
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: "copy docker-compose.yml"
|
|
|
|
template:
|
|
|
|
src: docker-compose.yml.j2
|
|
|
|
dest: "{{ docker_compose_file_path }}"
|
|
|
|
notify: docker compose project setup
|