mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 20:51:07 +01:00
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
---
|
|
- name: "include tasks nginx-docker-proxy-domain.yml"
|
|
include_tasks: nginx-docker-proxy-domain.yml
|
|
|
|
- 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: pull docker repository
|
|
git:
|
|
repo: "https://github.com/opf/openproject-deploy"
|
|
dest: "{{ repository_directory }}"
|
|
update: yes
|
|
force: yes
|
|
notify: recreate openproject
|
|
become: true
|
|
register: git_result
|
|
|
|
- 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: Warn if repo is not reachable
|
|
debug:
|
|
msg: "Warning: Repository is not reachable."
|
|
when: git_result.failed
|
|
|
|
- name: "copy .env"
|
|
template:
|
|
src: env.j2
|
|
dest: "{{ docker_compose_instance_directory }}.env"
|
|
notify: recreate openproject
|
|
|
|
- name: "copy docker-compose.yml"
|
|
template:
|
|
src: docker-compose.yml.j2
|
|
dest: "{{ docker_compose_file_path }}"
|
|
notify: recreate openproject
|