Files
ansible-runner/playbooks/deploy_grafana.yml.ansible
master of disaster 20644e85a2
Some checks failed
🏃‍♂️Run Ansible / install_ansible (push) Failing after 2m1s
add db task to playbook
2025-12-18 00:33:55 +01:00

33 lines
1.1 KiB
Plaintext

- hosts:
- grafana
- postgresql
gather_facts: true
become: true
tasks:
- name: Create List with right interface
ansible.builtin.set_fact:
node_ips_eth0: "{{ groups['gitea'] | map('extract', hostvars, ['ansible_facts', 'eth0', 'ipv4', 'address']) }}"
- name: Fügen Sie die Gitea pg_hba Einträge zur Patroni-Liste hinzu
ansible.builtin.set_fact:
# Fügt die neuen Zeilen zur Liste hinzu
postgresql_additional_pg_hba: "{{ postgresql_additional_pg_hba | default([]) + ['host ' + gitea_db_name + ' ' + gitea_db_user + ' ' + item + '/32 scram-sha-256'] }}"
loop: "{{ node_ips_eth0 }}"
run_once: true
- name: Update Patroni Configuration with new pg_hba entries
ansible.builtin.include_role:
name: postgresql
tasks_from: add_app_database.yml.ansible
vars:
postgresql_App_db_owner: "{{ grafana_db_user }}"
postgresql_App_db_owner_password: "{{ grafana_db_password }}"
postgresql_App_db_name: "{{ grafana_db_name }}"
- hosts:
- grafana
gather_facts: true
become: true
roles:
- grafana
- handlers