mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-06 10:21:34 +02:00
Huge role refactoring/cleanup. Other commits will propably follow. Because some bugs will exist. Still important for longrun and also for auto docs/help/slideshow generation
This commit is contained in:
31
roles/service-rdbms-central/tasks/main.yml
Normal file
31
roles/service-rdbms-central/tasks/main.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: "set database_application_id (Needed due to lazzy loading issue)"
|
||||
set_fact:
|
||||
database_application_id: "{{ application_id }}"
|
||||
|
||||
- name: "Load database variables"
|
||||
include_vars: "{{ item }}"
|
||||
loop:
|
||||
- "{{ docker_var_file }}" # Important to load docker variables first so that database can use them
|
||||
- "{{ database_var_file }}" # Important to load them before docker role so that backup can use them
|
||||
|
||||
# Docker Routines
|
||||
- name: "Include docker-compose role"
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
# The following env file will just be used from the dedicated mariadb container
|
||||
# and not the {{applications.mariadb.hostname }}-database
|
||||
- name: "Create {{database_env}}"
|
||||
template:
|
||||
src: "env/{{database_type}}.env.j2"
|
||||
dest: "{{database_env}}"
|
||||
notify: docker compose up
|
||||
when: not applications | is_feature_enabled('central_database',application_id)
|
||||
|
||||
- name: "Create central database"
|
||||
include_role:
|
||||
name: "web-app-{{database_type}}"
|
||||
when: applications | is_feature_enabled('central_database',application_id)
|
||||
|
||||
- name: "Add database to backup"
|
||||
include_tasks: "{{ playbook_dir }}/roles/backup-docker-to-local/tasks/seed-database-to-backup.yml"
|
Reference in New Issue
Block a user