Refactored use of variables

This commit is contained in:
2023-12-05 18:45:26 +01:00
parent 5ca94d6ecc
commit 3b06b5bcf4
50 changed files with 107 additions and 102 deletions

View File

@@ -81,7 +81,7 @@ Detailed steps for backing up your Akaunting instance, including setting manual
### Setting Variables
Variables are crucial in configuring your Akaunting setup. Ensure you set the following variables correctly in your environment:
- `docker_compose_akaunting_path`: Set this variable to the path where your Docker Compose files for Akaunting are located.
- `docker_compose_instance_directory`: Set this variable to the path where your Docker Compose files for Akaunting are located.
- `akaunting_db_password`, `akaunting_version`, `akaunting_company_name`, `akaunting_company_email`, `akaunting_setup_admin_email`, and `akaunting_setup_admin_password`: These should be set in your `.env` files as per your requirements.
### Additional Configuration

View File

@@ -2,7 +2,7 @@
- name: setup akaunting
command:
cmd: docker-compose -p akaunting up -d --force-recreate
chdir: "{{docker_compose_akaunting_path}}"
chdir: "{{docker_compose_instance_directory}}"
environment:
#AKAUNTING_SETUP: true
COMPOSE_HTTP_TIMEOUT: 600

View File

@@ -8,20 +8,20 @@
- name: register directory
stat:
path: "{{docker_compose_akaunting_path}}"
register: docker_compose_akaunting_path_register
path: "{{docker_compose_instance_directory}}"
register: docker_compose_instance_directory_register
- name: checkout repository
ansible.builtin.shell: git checkout .
become: true
args:
chdir: "{{docker_compose_akaunting_path}}"
when: docker_compose_akaunting_path_register.stat.exists
chdir: "{{docker_compose_instance_directory}}"
when: docker_compose_instance_directory_register.stat.exists
- name: pull docker repository
git:
repo: "https://github.com/akaunting/docker.git"
dest: "{{docker_compose_akaunting_path}}"
dest: "{{docker_compose_instance_directory}}"
update: yes
notify: setup akaunting
become: true
@@ -37,12 +37,12 @@
ansible.builtin.shell: find . -type f -exec sed -i 's/akaunting:latest/akaunting:{{akaunting_version}}/' {} + && find . -type f -exec sed -i 's/version=latest/version={{akaunting_version}}/' {} +
become: true
args:
chdir: "{{docker_compose_akaunting_path}}"
chdir: "{{docker_compose_instance_directory}}"
- name: configure db.env
template: src=db.env.j2 dest={{docker_compose_akaunting_path}}/env/db.env
template: src=db.env.j2 dest={{docker_compose_instance_directory}}/env/db.env
notify: setup akaunting
- name: configure run.env
template: src=run.env.j2 dest={{docker_compose_akaunting_path}}/env/run.env
template: src=run.env.j2 dest={{docker_compose_instance_directory}}/env/run.env
notify: setup akaunting

View File

@@ -1 +1 @@
docker_compose_akaunting_path: "{{path_docker_compose_files}}akaunting/"
docker_compose_instance_directory: "{{path_docker_compose_files}}akaunting/"