mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-12-22 18:35:03 +01:00
Implemented update-repository-with-files.yml
This commit is contained in:
parent
4735081128
commit
06537dfe9a
@ -1,6 +1,5 @@
|
||||
docker_compose_project_name: "akaunting"
|
||||
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
|
||||
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose.yml.backup"
|
||||
database_type: "mariadb"
|
||||
database_password: "{{akaunting_database_password}}"
|
||||
repository_address: "https://github.com/akaunting/docker.git"
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
docker_compose_project_name: "attendize"
|
||||
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
|
||||
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose.yml.backup"
|
||||
mail_interface_domain: "mail.{{domain}}"
|
||||
database_type: "mariadb"
|
||||
database_password: "{{attendize_database_password}}"
|
||||
|
@ -2,7 +2,6 @@ docker_compose_project_name: "openproject"
|
||||
repository_directory: "{{ path_docker_compose_instances }}{{docker_compose_project_name}}/"
|
||||
docker_compose_instance_directory: "{{repository_directory}}compose/"
|
||||
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
|
||||
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose.yml.backup"
|
||||
database_password: "{{openproject_database_password}}"
|
||||
repository_address: "https://github.com/opf/openproject-deploy"
|
||||
database_type: "postgres"
|
||||
|
@ -5,8 +5,13 @@
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
||||
- name: "include tasks update-repository-with-docker-compose.yml"
|
||||
include_tasks: update-repository-with-docker-compose.yml
|
||||
- name: "include tasks update-repository-with-files.yml"
|
||||
include_tasks: update-repository-with-files.yml
|
||||
vars:
|
||||
detached_files:
|
||||
- .env
|
||||
- docker-compose.yml
|
||||
- docker-compose-init.yml
|
||||
|
||||
- name: configure run.env
|
||||
template: src=env.j2 dest={{docker_compose_instance_directory}}/.env
|
||||
|
@ -1,6 +1,5 @@
|
||||
docker_compose_project_name: "taigaio"
|
||||
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
|
||||
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose.yml.backup"
|
||||
database_type: "postgres"
|
||||
database_password: "{{taigaio_database_password}}"
|
||||
repository_address: "https://github.com/taigaio/taiga-docker"
|
||||
|
@ -1,34 +1,5 @@
|
||||
- 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
|
||||
- name: "include tasks update-repository-with-files.yml"
|
||||
include_tasks: update-repository-with-files.yml
|
||||
vars:
|
||||
detached_files:
|
||||
- "{{docker_compose_file_path}}"
|
37
tasks/update-repository-with-files.yml
Normal file
37
tasks/update-repository-with-files.yml
Normal file
@ -0,0 +1,37 @@
|
||||
- name: "backup docker-compose.yml if it exists"
|
||||
command: >
|
||||
mv "{{docker_compose_instance_directory}}{{ item }}" "/tmp/{{docker_compose_project_name}}-{{ item }}.backup"
|
||||
args:
|
||||
removes: "{{docker_compose_instance_directory}}{{ item }}"
|
||||
become: true
|
||||
loop: "{{ detached_files }}"
|
||||
|
||||
- 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 "/tmp/{{docker_compose_project_name}}-{{ item }}.backup" "{{docker_compose_instance_directory}}{{ item }}"
|
||||
args:
|
||||
removes: "/tmp/{{docker_compose_project_name}}-{{ item }}.backup"
|
||||
become: true
|
||||
loop: "{{ detached_files }}"
|
||||
|
||||
- name: "copy {{ item }}"
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{docker_compose_instance_directory}}{{ item }}"
|
||||
loop: "{{ detached_files }}"
|
||||
notify: docker compose project setup
|
Loading…
Reference in New Issue
Block a user