2022-01-18 19:08:45 +01:00
|
|
|
---
|
2023-12-06 17:59:57 +01:00
|
|
|
- name: "include tasks nginx-docker-proxy-domain.yml"
|
|
|
|
include_tasks: nginx-docker-proxy-domain.yml
|
2022-01-18 19:08:45 +01:00
|
|
|
|
2022-09-01 20:33:19 +02:00
|
|
|
- name: register directory
|
|
|
|
stat:
|
2023-12-05 18:45:26 +01:00
|
|
|
path: "{{docker_compose_instance_directory}}"
|
|
|
|
register: docker_compose_instance_directory_register
|
2022-09-01 20:33:19 +02:00
|
|
|
|
|
|
|
- name: checkout repository
|
|
|
|
ansible.builtin.shell: git checkout .
|
|
|
|
become: true
|
|
|
|
args:
|
2023-12-05 18:45:26 +01:00
|
|
|
chdir: "{{docker_compose_instance_directory}}"
|
|
|
|
when: docker_compose_instance_directory_register.stat.exists
|
2022-09-01 20:33:19 +02:00
|
|
|
|
2022-01-18 19:08:45 +01:00
|
|
|
- name: pull docker repository
|
|
|
|
git:
|
|
|
|
repo: "https://github.com/akaunting/docker.git"
|
2023-12-05 18:45:26 +01:00
|
|
|
dest: "{{docker_compose_instance_directory}}"
|
2022-01-18 19:08:45 +01:00
|
|
|
update: yes
|
2022-09-01 20:33:19 +02:00
|
|
|
notify: setup akaunting
|
|
|
|
become: true
|
2023-05-28 23:08:38 +02:00
|
|
|
register: git_result
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Warn if repo is not reachable
|
|
|
|
debug:
|
|
|
|
msg: "Warning: Repository is not reachable."
|
|
|
|
when: git_result.failed
|
2022-09-01 20:33:19 +02:00
|
|
|
|
|
|
|
- name: set akaunting version
|
2023-12-13 15:16:02 +01:00
|
|
|
ansible.builtin.shell: find . -type f -exec sed -i 's/akaunting:latest/akaunting:{{version_akaunting}}/' {} + && find . -type f -exec sed -i 's/version=latest/version={{version_akaunting}}/' {} +
|
2022-09-01 20:33:19 +02:00
|
|
|
become: true
|
|
|
|
args:
|
2023-12-05 18:45:26 +01:00
|
|
|
chdir: "{{docker_compose_instance_directory}}"
|
2022-01-18 19:08:45 +01:00
|
|
|
|
|
|
|
- name: configure db.env
|
2023-12-05 18:45:26 +01:00
|
|
|
template: src=db.env.j2 dest={{docker_compose_instance_directory}}/env/db.env
|
2022-01-18 19:26:44 +01:00
|
|
|
notify: setup akaunting
|
2022-01-18 19:08:45 +01:00
|
|
|
|
|
|
|
- name: configure run.env
|
2023-12-05 18:45:26 +01:00
|
|
|
template: src=run.env.j2 dest={{docker_compose_instance_directory}}/env/run.env
|
2022-01-18 19:26:44 +01:00
|
|
|
notify: setup akaunting
|