mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-14 00:41:06 +01:00
34 lines
926 B
YAML
34 lines
926 B
YAML
- 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}}"
|
|
ignore_errors: true
|
|
|
|
- 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 |