consul/tasks/ssl/main.yaml
2024-03-19 13:56:23 +03:00

27 lines
908 B
YAML

- name: Add host to {{ consul_cacert_ca_host_group }}
add_host:
groups: "{{ consul_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[consul_cacert_ca_host_group] is not defined
- name: Add all hosts to {{ consul_cacert_clients_group }}
add_host:
groups: "{{ consul_cacert_clients_group }}"
hostname: "{{ hostvars[item]['ansible_hostname'] }}"
ansible_host: "{{ hostvars[item]['ansible_host'] }}"
with_items:
- "{{ ansible_play_hosts }}"
changed_when: false
when: groups[consul_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[consul_cacert_clients_group] }}"