Files
computer-playbook/roles/sys-svc-rdbms/tasks/dedicated.yml

43 lines
1.5 KiB
YAML

---
- name: "📂 For '{{ application_id }}': own the compose handler topic"
ansible.builtin.include_role:
name: sys-svc-compose
tasks_from: none.yml
handlers_from: main
- name: "🥾 For '{{ application_id }}': bootstrap the compose host once"
ansible.builtin.include_role:
name: sys-svc-compose
tasks_from: 00_core.yml
when: run_once_sys_svc_compose is not defined
- name: "✅ Ensure env dir exists: {{ _container_env_dir }}"
ansible.builtin.file:
path: "{{ _container_env_dir }}"
state: directory
mode: "0755"
- name: "📄 For '{{ application_id }}/{{ _database_consumer_id }}': Create env file"
stack_host_template:
src: "env/{{ _database_type }}.env.j2"
dest: "{{ _database_env }}"
notify: compose-up
- name: "📄 Render the credential realignment for '{{ _database_consumer_id }}'"
stack_host_template:
src: "sql/mariadb-realign.sql.j2"
dest: "{{ lookup('database', _database_consumer_id, 'realign_sql') }}"
when: _database_type == 'mariadb'
notify: compose-up
- name: "🔧 For '{{ application_id }}/{{ _database_consumer_id }}': Apply postgres setup"
include_tasks: dedicated_postgres.yml
when: _database_type == 'postgres'
- name: "🔧 For '{{ application_id }}/{{ _database_consumer_id }}': Seed the backup entry"
include_tasks: utils/seed_backup.yml
when:
- "'svc-bkp-volume-2-local' in group_names"
- IS_STACK_HOST | bool
- lookup('database', _database_consumer_id, 'managed') | bool