From c7d6e8c68c6351cadac02f713a497121cea2c521 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 8 Jan 2024 19:38:36 +0100 Subject: [PATCH] Renamed modes --- group_vars/all | 10 +++++++--- roles/backup-docker-to-local/tasks/main.yml | 2 +- roles/docker-discourse/tasks/main.yml | 6 +++--- roles/docker-matrix-ansible/tasks/main.yml | 3 +-- tasks/docker-compose-common.yml | 2 +- tasks/recieve-certbot-certificate.yml | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/group_vars/all b/group_vars/all index 7a5b0993..3690559a 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,12 +1,16 @@ # General -reset_files: false # Cleans up all CyMaIS files. It's necessary to run to whole playbook and not particial roles when using this function. -verbose: false # Prints well formated debug information -test_run: false # Executes test routines instead of productive routines database_delay: "0" # Database delay to wait for the central database before continue tasks top_domain: "localhost" # Change this in inventory to your domain ip4_address: "127.0.0.1" # Change thie in inventory to the ip address of your server backups_folder_path: "/Backups/" # Path to the backups folder +# Mode + +# The following modes can be combined with each other +mode_reset: false # Cleans up all CyMaIS files. It's necessary to run to whole playbook and not particial roles when using this function. +mode_verbose: false # Prints well formated debug information +mode_test: false # Executes test routines instead of productive routines + # Server Tact Variables ## Ours in which the server is 100% working. Rest of the time is reserved for maintanance diff --git a/roles/backup-docker-to-local/tasks/main.yml b/roles/backup-docker-to-local/tasks/main.yml index b069918e..dbcbc291 100644 --- a/roles/backup-docker-to-local/tasks/main.yml +++ b/roles/backup-docker-to-local/tasks/main.yml @@ -45,7 +45,7 @@ file: path: "{{ backup_docker_to_local_folder }}databases.csv" state: absent - when: reset_files | bool and run_once_backup_docker_to_local is not defined + when: mode_reset | bool and run_once_backup_docker_to_local is not defined - name: seed database values command: diff --git a/roles/docker-discourse/tasks/main.yml b/roles/docker-discourse/tasks/main.yml index deca9d74..773d1989 100644 --- a/roles/docker-discourse/tasks/main.yml +++ b/roles/docker-discourse/tasks/main.yml @@ -16,19 +16,19 @@ command: cmd: "docker stop discourse_application" ignore_errors: true - when: reset_files | bool + when: mode_reset | bool - name: "rm container discourse_application" command: cmd: "docker rm discourse_application" ignore_errors: true - when: reset_files | bool + when: mode_reset | bool - name: "cleanup central database from {{docker_compose_project_name}}_default network" command: cmd: "docker network disconnect discourse_default central-{{ database_type }}" ignore_errors: true - when: reset_files | bool + when: mode_reset | bool - name: add docker-compose.yml template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml diff --git a/roles/docker-matrix-ansible/tasks/main.yml b/roles/docker-matrix-ansible/tasks/main.yml index 074f45c8..c8196e59 100644 --- a/roles/docker-matrix-ansible/tasks/main.yml +++ b/roles/docker-matrix-ansible/tasks/main.yml @@ -65,11 +65,10 @@ become: false delegate_to: localhost - - name: show variable information debug: msg: "hosts_path: {{hosts_path}}\nmatrix_inventory_tmp_dir:{{ matrix_inventory_tmp_dir }}" - when: verbose | bool + when: mode_verbose | bool - name: install requirements local_action: command just roles diff --git a/tasks/docker-compose-common.yml b/tasks/docker-compose-common.yml index 4dec416a..5585e93d 100644 --- a/tasks/docker-compose-common.yml +++ b/tasks/docker-compose-common.yml @@ -9,7 +9,7 @@ file: path: "{{ docker_compose_instance_directory }}" state: absent - when: reset_files | bool + when: mode_reset | bool - name: "create {{docker_compose_instance_directory}}" file: diff --git a/tasks/recieve-certbot-certificate.yml b/tasks/recieve-certbot-certificate.yml index 2b72abfe..1b0781bd 100644 --- a/tasks/recieve-certbot-certificate.yml +++ b/tasks/recieve-certbot-certificate.yml @@ -2,4 +2,4 @@ command: >- certbot certonly --agree-tos --email {{ administrator_email }} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ domain }} - {{ '--test-cert' if test_run | bool else '' }} \ No newline at end of file + {{ '--test-cert' if mode_test | bool else '' }} \ No newline at end of file