From 03c04eadf784a74e820fafd9287806c8af37e1b7 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 9 Jan 2024 12:52:49 +0100 Subject: [PATCH] Optimized setup_mode --- group_vars/all | 9 ++------- roles/docker-listmonk/tasks/main.yml | 4 ++-- roles/docker-mailu/tasks/main.yml | 4 ++-- roles/docker-mastodon/tasks/main.yml | 4 ++-- servers.yml | 6 +----- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/group_vars/all b/group_vars/all index e67437dc..d3294459 100644 --- a/group_vars/all +++ b/group_vars/all @@ -12,6 +12,8 @@ mode_verbose: false # Prints well formated debug information mode_test: false # Executes test routines instead of productive routines mode_update: true # Executes updates mode_backup: true # Activates the backup before the update procedure +mode_setup: false # Execute the setup and initializing procedures + # Server Tact Variables @@ -107,13 +109,6 @@ nginx_upstreams_directory: "{{nginx_configuration_directory}}upstreams/" ## Docker Applications -### Enable Setup -setup_default: "false" # Pass CLI commands to execute the setup tasks for the different roles -setup_akaunting: "{{setup_default}}" -setup_mailu: "{{setup_default}}" -setup_listmonk: "{{setup_default}}" -setup_mastodon: "{{setup_default}}" - ### Enable Central MariaDB enable_central_database: true diff --git a/roles/docker-listmonk/tasks/main.yml b/roles/docker-listmonk/tasks/main.yml index 39388ec4..aaf046a4 100644 --- a/roles/docker-listmonk/tasks/main.yml +++ b/roles/docker-listmonk/tasks/main.yml @@ -20,10 +20,10 @@ - name: flush docker service meta: flush_handlers - when: setup | bool + when: mode_setup |bool - name: setup routine for listmonk command: cmd: docker compose run -T --rm application sh -c "yes | ./listmonk --install" chdir: "{{docker_compose_instance_directory}}" - when: setup | bool \ No newline at end of file + when: mode_setup |bool \ No newline at end of file diff --git a/roles/docker-mailu/tasks/main.yml b/roles/docker-mailu/tasks/main.yml index a49d34ce..af6e1625 100644 --- a/roles/docker-mailu/tasks/main.yml +++ b/roles/docker-mailu/tasks/main.yml @@ -64,11 +64,11 @@ - name: flush docker service meta: flush_handlers - when: setup | bool + when: mode_setup |bool - name: execute database migration command: cmd: "docker compose -p mailu exec admin flask mailu admin admin {{top_domain}} {{mailu_initial_root_password}}" chdir: "{{docker_compose_instance_directory}}" ignore_errors: true - when: setup | bool \ No newline at end of file + when: mode_setup |bool \ No newline at end of file diff --git a/roles/docker-mastodon/tasks/main.yml b/roles/docker-mastodon/tasks/main.yml index 24424c5e..cc1ae829 100644 --- a/roles/docker-mastodon/tasks/main.yml +++ b/roles/docker-mastodon/tasks/main.yml @@ -20,10 +20,10 @@ - name: flush docker service meta: flush_handlers - when: setup | bool + when: mode_setup |bool - name: setup routine for mastodon command: cmd: "docker-compose run --rm web bundle exec rails db:migrate" chdir: "{{docker_compose_instance_directory}}" - when: setup | bool \ No newline at end of file + when: mode_setup |bool \ No newline at end of file diff --git a/servers.yml b/servers.yml index f9e567c7..d1c955eb 100644 --- a/servers.yml +++ b/servers.yml @@ -77,8 +77,7 @@ vars: domain: "{{domain_mailu}}" http_port: 8007 - setup: "{{ setup_mailu }}" - + - name: setup elk hosts hosts: elk become: true @@ -98,7 +97,6 @@ domains: "{{ [domain] + domains_mastodon_alternates }}" http_port: 8009 stream_port: 4001 - setup: "{{ setup_mastodon }}" - name: setup pixelfed hosts hosts: pixelfed @@ -190,7 +188,6 @@ vars: domain: "{{domain_listmonk}}" http_port: 8019 - setup: "{{ setup_listmonk }}" - name: setup discourse hosts: discourse @@ -249,7 +246,6 @@ vars: domain: "{{domain_akaunting}}" http_port: 8025 - setup: "{{ setup_akaunting }}" # Native Webserver Roles - name: setup nginx-homepages