2017-02-08 21:41:36 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: sync_etcd_node_certs | Create list of node certs needing creation
|
2017-08-24 09:09:52 +00:00
|
|
|
set_fact:
|
2017-09-14 11:28:11 +00:00
|
|
|
etcd_node_cert_list: "{{ etcd_node_cert_list|default([]) + ['node-' + inventory_hostname + '.pem'] }}"
|
2017-02-08 21:41:36 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../../vault/tasks/shared/sync_file.yml
|
2017-08-24 09:09:52 +00:00
|
|
|
vars:
|
2017-02-08 21:41:36 +00:00
|
|
|
sync_file: "{{ item }}"
|
|
|
|
sync_file_dir: "{{ etcd_cert_dir }}"
|
2017-09-14 11:28:11 +00:00
|
|
|
sync_file_hosts: [ "{{ inventory_hostname }}" ]
|
2017-02-08 21:41:36 +00:00
|
|
|
sync_file_is_cert: true
|
|
|
|
with_items: "{{ etcd_node_cert_list|d([]) }}"
|
|
|
|
|
|
|
|
- name: sync_etcd_node_certs | Set facts for etcd sync_file results
|
|
|
|
set_fact:
|
|
|
|
etcd_node_certs_needed: "{{ etcd_node_certs_needed|default([]) + [item.path] }}"
|
|
|
|
with_items: "{{ sync_file_results|d([]) }}"
|
|
|
|
when: item.no_srcs|bool
|
|
|
|
|
|
|
|
- name: sync_etcd_node_certs | Unset sync_file_results after etcd node certs
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../../vault/tasks/shared/sync_file.yml
|
2017-08-24 09:09:52 +00:00
|
|
|
vars:
|
2017-02-08 21:41:36 +00:00
|
|
|
sync_file: ca.pem
|
|
|
|
sync_file_dir: "{{ etcd_cert_dir }}"
|
2017-09-14 11:28:11 +00:00
|
|
|
sync_file_hosts: "{{ groups['etcd'] }}"
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- name: sync_etcd_node_certs | Unset sync_file_results after ca.pem
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|