From e87c3e2090d06926df3310c06ecf750dffcd97d4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 18 Feb 2025 15:07:09 +0100 Subject: [PATCH] Optimized setup procedure in preparation for automatic keycloak realm import --- group_vars/all/01_modes.yml | 1 - group_vars/all/07_applications.yml | 8 ++++++-- roles/docker-bigbluebutton/tasks/main.yml | 6 +++--- roles/docker-listmonk/tasks/main.yml | 4 ++-- roles/docker-mailu/tasks/main.yml | 4 ++-- roles/docker-mastodon/tasks/main.yml | 4 ++-- roles/docker-matrix-compose/tasks/main.yml | 4 ++-- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/group_vars/all/01_modes.yml b/group_vars/all/01_modes.yml index 185c783d..59a04716 100644 --- a/group_vars/all/01_modes.yml +++ b/group_vars/all/01_modes.yml @@ -5,5 +5,4 @@ mode_reset: false # Cleans up all CyMaIS files. It's necessary to run to whole 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 mode_cleanup: false # Cleanup unused files and configurations \ No newline at end of file diff --git a/group_vars/all/07_applications.yml b/group_vars/all/07_applications.yml index 1498f645..8bf160c2 100644 --- a/group_vars/all/07_applications.yml +++ b/group_vars/all/07_applications.yml @@ -30,6 +30,7 @@ defaults_applications: ## Big Blue Button bigbluebutton: enable_greenlight: "true" + setup: false # Set to true in inventory file for initial setup ## Bluesky bluesky: @@ -99,6 +100,7 @@ defaults_applications: administrator_username: "{{administrator_username}}" public_api_activated: False # Security hole. Can be used for spaming version: "latest" + setup: false # Set true in inventory file to execute the setup and initializing procedures ## MariaDB mariadb: @@ -111,7 +113,8 @@ defaults_applications: ## Mastodon mastodon: version: "latest" - single_user_mode: false + single_user_mode: false # Set true for initial setup + setup: false # Set true in inventory file to execute the setup and initializing procedures ## Matrix matrix: @@ -123,12 +126,13 @@ defaults_applications: version: "latest" element: version: "latest" + setup: false # Set true in inventory file to execute the setup and initializing procedures ## Mailu mailu: version: "2024.06" domain: "{{primary_domain}}" - subnet: "192.168.203.0/24" + setup: false # Set true in inventory file to execute the setup and initializing procedures ## Moodle moodle: diff --git a/roles/docker-bigbluebutton/tasks/main.yml b/roles/docker-bigbluebutton/tasks/main.yml index ed58b6dc..faf89779 100644 --- a/roles/docker-bigbluebutton/tasks/main.yml +++ b/roles/docker-bigbluebutton/tasks/main.yml @@ -44,17 +44,17 @@ - name: wait for database pause: seconds: "{{pause_duration}}" - when: mode_setup | bool + when: appplications.bigbluebutton.setup | bool - name: create admin command: cmd: docker compose exec greenlight bundle exec rake admin:create chdir: "{{docker_compose.directories.instance}}" - when: mode_setup | bool + when: appplications.bigbluebutton.setup | bool ignore_errors: true register: admin_creation_result - name: print admin user data debug: msg: "{{ admin_creation_result.stdout }}" - when: mode_setup | bool \ No newline at end of file + when: appplications.bigbluebutton.setup | bool \ No newline at end of file diff --git a/roles/docker-listmonk/tasks/main.yml b/roles/docker-listmonk/tasks/main.yml index 43d9e22c..98e72c6e 100644 --- a/roles/docker-listmonk/tasks/main.yml +++ b/roles/docker-listmonk/tasks/main.yml @@ -26,10 +26,10 @@ - name: flush docker service meta: flush_handlers - when: mode_setup |bool + when: appplications.listmonk.setup |bool - name: setup routine for listmonk command: cmd: docker compose run -T --rm application sh -c "yes | ./listmonk --install" chdir: "{{docker_compose.directories.instance}}" - when: mode_setup |bool \ No newline at end of file + when: appplications.listmonk.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 26caf19d..304f97cc 100644 --- a/roles/docker-mailu/tasks/main.yml +++ b/roles/docker-mailu/tasks/main.yml @@ -17,11 +17,11 @@ - name: flush docker service meta: flush_handlers - when: mode_setup |bool + when: appplications.mailu.setup |bool - name: execute database migration command: cmd: "docker compose -p mailu exec admin flask mailu admin admin {{primary_domain}} {{mailu_initial_root_password}}" chdir: "{{docker_compose.directories.instance}}" ignore_errors: true - when: mode_setup |bool \ No newline at end of file + when: appplications.mailu.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 63fc6561..9ba229b6 100644 --- a/roles/docker-mastodon/tasks/main.yml +++ b/roles/docker-mastodon/tasks/main.yml @@ -14,10 +14,10 @@ - name: flush docker service meta: flush_handlers - when: mode_setup |bool + when: appplications.mastodon.setup |bool - name: setup routine for mastodon command: cmd: "docker-compose run --rm web bundle exec rails db:migrate" chdir: "{{docker_compose.directories.instance}}" - when: mode_setup |bool \ No newline at end of file + when: appplications.mastodon.setup |bool \ No newline at end of file diff --git a/roles/docker-matrix-compose/tasks/main.yml b/roles/docker-matrix-compose/tasks/main.yml index 69026528..3dfb7b4e 100644 --- a/roles/docker-matrix-compose/tasks/main.yml +++ b/roles/docker-matrix-compose/tasks/main.yml @@ -136,11 +136,11 @@ cmd: docker compose exec -it synapse register_new_matrix_user -u {{applications.matrix.administrator_username}} -p {{matrix_admin_password}} -a -c /data/homeserver.yaml http://localhost:8008 chdir: "{{ docker_compose.directories.instance }}" ignore_errors: true - when: mode_setup | bool + when: appplications.matrix.setup | bool - name: create chatgpt bot command: cmd: docker compose exec -it synapse register_new_matrix_user -u chatgptbot -p {{matrix_chatgpt_bridge_user_password}} -a -c /data/homeserver.yaml http://localhost:8008 chdir: "{{ docker_compose.directories.instance }}" ignore_errors: true - when: mode_setup | bool \ No newline at end of file + when: appplications.matrix.setup | bool \ No newline at end of file