2023-12-22 15:49:55 +01:00
|
|
|
---
|
|
|
|
- name: "include tasks nginx-docker-proxy-domain.yml"
|
|
|
|
include_tasks: nginx-docker-proxy-domain.yml
|
|
|
|
|
2023-12-24 18:48:38 +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
|
2023-12-22 15:49:55 +01:00
|
|
|
|
|
|
|
- name: pull docker repository
|
|
|
|
git:
|
|
|
|
repo: "https://github.com/opf/openproject-deploy"
|
2023-12-24 18:48:38 +01:00
|
|
|
dest: "{{ repository_directory }}"
|
2023-12-22 15:49:55 +01:00
|
|
|
update: yes
|
2023-12-24 21:42:32 +01:00
|
|
|
force: yes
|
2023-12-22 15:49:55 +01:00
|
|
|
notify: recreate openproject
|
|
|
|
become: true
|
|
|
|
register: git_result
|
2023-12-24 18:48:38 +01:00
|
|
|
|
|
|
|
- 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
|
2023-12-22 15:49:55 +01:00
|
|
|
|
|
|
|
- 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
|
2023-12-24 18:48:38 +01:00
|
|
|
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
|