37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
- hosts:
|
|
- grafana
|
|
- postgresql
|
|
gather_facts: true
|
|
become: true
|
|
tasks:
|
|
- debug: var=grafana_db_user
|
|
- debug: var=grafana_db_password
|
|
- debug: var=grafana_db_name
|
|
|
|
- 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 |