mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented docker-compose.yml file https://chat.openai.com/share/981ecca4-9df7-4086-b99e-1b60f2632bf6
This commit is contained in:
@@ -2,21 +2,40 @@
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
||||
- name: "create {{ repository_directory }}"
|
||||
file:
|
||||
path: "{{ repository_directory }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
- name: register repository_directory_register
|
||||
stat:
|
||||
path: "{{repository_directory}}"
|
||||
register: repository_directory_register
|
||||
|
||||
- name: checkout repository
|
||||
ansible.builtin.shell: git checkout .
|
||||
become: true
|
||||
args:
|
||||
chdir: "{{repository_directory}}"
|
||||
when: repository_directory_register.stat.exists
|
||||
|
||||
- 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}}"
|
||||
dest: "{{ repository_directory }}"
|
||||
update: yes
|
||||
notify: recreate openproject
|
||||
become: true
|
||||
register: git_result
|
||||
ignore_errors: 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: Warn if repo is not reachable
|
||||
debug:
|
||||
@@ -26,5 +45,11 @@
|
||||
- name: "copy .env"
|
||||
template:
|
||||
src: env.j2
|
||||
dest: "{{docker_compose_instance_directory}}.env"
|
||||
notify: recreate openproject
|
||||
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
|
||||
|
Reference in New Issue
Block a user