computer-playbook/roles/docker-akaunting/tasks/main.yml

45 lines
1.4 KiB
YAML
Raw Normal View History

2022-01-18 19:08:45 +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
- name: register directory
stat:
2023-12-05 18:45:26 +01:00
path: "{{docker_compose_instance_directory}}"
register: docker_compose_instance_directory_register
- 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-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
notify: setup akaunting
become: true
register: git_result
ignore_errors: true
- name: Warn if repo is not reachable
debug:
msg: "Warning: Repository is not reachable."
when: git_result.failed
- name: set akaunting version
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}}/' {} +
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