From eb779c91bd084e942c209fd8cbc6edaaf375f373 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 5 Jan 2024 23:13:46 +0100 Subject: [PATCH] Optimized all file and implemented setup procedures --- group_vars/all | 76 ++++++++++++++++++++++++---- roles/docker-listmonk/tasks/main.yml | 12 ++++- roles/docker-mailu/tasks/main.yml | 12 ++++- roles/docker-mastodon/tasks/main.yml | 6 ++- 4 files changed, 94 insertions(+), 12 deletions(-) diff --git a/group_vars/all b/group_vars/all index 028e88e5..b13ce22b 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,3 +1,49 @@ +# PASSWORDS AND SECRETS: + +akaunting_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +akaunting_setup_admin_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +baserow_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_etherpad_api_key: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_fsesl_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_rails_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_shared_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_postgresql_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +bigbluebutton_turn_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +central_mariadb_root_password: "ATTENTION_REPLACEPASSWORD" +central_postgres_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +discourse_database_password: "KnuthAlgoM@ster1938" +gitlab_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +gitlab_initial_root_password: "AdaL0velace&AlanTuringR0ck!" +gitea_database_password: "BabbageDiffEngine1791" +listmonk_admin_password: "HopperDebugQu33n1906" +listmonk_database_password: "TuringTestW1nn3r195" +mailu_api_token: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mailu_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mailu_initial_root_password: "VonNeumannMatrix42$$" +mailu_secret_key: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mastodon_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mastodon_otp_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mastodon_secret_key_base: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mastodon_vapid_private_key: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +mastodon_vapid_public_key: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matomo_auth_token: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matomo_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matrix_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matrix_generic_secret_key: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matrix_form_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matrix_macaroon_secret_key: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +matrix_registration_shared_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +nextcloud_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +openproject_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +peertube_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +peertube_secret: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +pixelfed_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +pixelfed_app_key: "base64:DUMMY_VALUE_NEEDS_TO_BE_CHANGED=" +wordpress_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +yourls_database_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +yourls_user_password: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" + # General setup: false # Pass CLI commands to execute the setup tasks for the different roles verbose: false # Prints well formated debug information @@ -137,25 +183,37 @@ postgres_default_version: "16" ### Docker Role Specific Parameters -#### Pixelfed -pixelfed_app_name: "Pictures" +#### Akaunting +version_akaunting: "latest" +akaunting_company_name: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +akaunting_company_email: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" +akaunting_setup_admin_email: "DUMMY_VALUE_NEEDS_TO_BE_CHANGED" + +#### Listmonk +listmonk_admin_username: "admin" + +#### Mastodon +version_mastodon: "latest" +mastodon_single_user_mode: false #### Matrix matrix_playbook_tags: "setup-all,start" # For the initial update use: install-all,ensure-matrix-users-created,start matrix_role: "compose" # Role to setup Matrix. Valid values: ansible, compose -#### Mastodon -version_mastodon: "latest" - -#### Akaunting -version_akaunting: "latest" - #### Mailu -version_mailu: "2.0" +version_mailu: "2.0" +mailu_domain: "{{top_domain}}" #### Nextcloud version_nextcloud: "production" # Danger: Nextcloud can't skipp major version updates. +#### Pixelfed +pixelfed_app_name: "Pictures" + +#### YOURLS +yourls_user: "admin" + + # Routing Configurations for Domain Redirections redirect_domain_mappings: - { source: "bbb.{{top_domain}}", target: "{{domain_bigbluebutton}}" } diff --git a/roles/docker-listmonk/tasks/main.yml b/roles/docker-listmonk/tasks/main.yml index 66a0413b..dba57709 100644 --- a/roles/docker-listmonk/tasks/main.yml +++ b/roles/docker-listmonk/tasks/main.yml @@ -21,4 +21,14 @@ template: src: "config.toml.j2" dest: "{{docker_compose_instance_directory}}config.toml" - notify: docker compose project setup \ No newline at end of file + notify: docker compose project setup + +- name: flush docker service + meta: flush_handlers + when: setup | bool + +- name: setup routine for listmonk + command: + cmd: "yes | docker compose run -T --rm application ./listmonk --install" + chdir: "{{docker_compose_instance_directory}}" + when: 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 8bb1a1dc..ac19de2d 100644 --- a/roles/docker-mailu/tasks/main.yml +++ b/roles/docker-mailu/tasks/main.yml @@ -60,4 +60,14 @@ vars: on_calendar: "{{on_calendar_deploy_mailu_certificates}}" service_name: "deploy-letsencrypt-mailu" - persistent: "true" \ No newline at end of file + persistent: "true" + +- name: flush docker service + meta: flush_handlers + when: 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}}" + when: 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 ba05ad2a..272773d4 100644 --- a/roles/docker-mastodon/tasks/main.yml +++ b/roles/docker-mastodon/tasks/main.yml @@ -24,7 +24,11 @@ dest: "{{docker_compose_instance_directory}}.env.production" notify: docker compose project setup -- name: execute database migration +- name: flush docker service + meta: flush_handlers + when: setup | bool + +- name: setup routine for mastodon command: cmd: "docker-compose run --rm web bundle exec rails db:migrate" chdir: "{{docker_compose_instance_directory}}"