patroni/tasks/ssl/main.yaml
2024-03-19 14:04:46 +03:00

27 lines
915 B
YAML

- name: Add host to {{ patroni_cacert_ca_host_group }}
add_host:
groups: "{{ patroni_cacert_ca_host_group }}"
hostname: "{{ hostvars[item]['ansible_hostname'] }}"
ansible_host: "{{ hostvars[item]['ansible_host'] }}"
with_items:
- "{{ ansible_play_hosts[0] }}"
changed_when: false
when: groups[patroni_cacert_ca_host_group] is not defined
- name: Add all hosts to {{ patroni_cacert_clients_group }}
add_host:
groups: "{{ patroni_cacert_clients_group }}"
hostname: "{{ hostvars[item]['ansible_hostname'] }}"
ansible_host: "{{ hostvars[item]['ansible_host'] }}"
with_items:
- "{{ ansible_play_hosts }}"
changed_when: false
when: groups[patroni_cacert_clients_group] is not defined
- name: CA and certs | Include CA
include_tasks: ca.yaml
- name: CA and certs | Include Certificates
include_tasks: certs.yaml
loop: "{{ groups[patroni_cacert_clients_group] }}"