2017-02-08 21:41:36 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: sync_etcd_node_certs | Create list of node certs needing creation
|
|
|
|
set_fact:
|
|
|
|
etcd_node_cert_list: "{{ etcd_node_cert_list|default([]) + ['node-' + item + '.pem'] }}"
|
2017-06-30 11:46:05 +00:00
|
|
|
with_items: "{{ etcd_node_cert_hosts | unique }}"
|
2017-06-24 11:26:47 +00:00
|
|
|
run_once: true
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- include: ../../vault/tasks/shared/sync_file.yml
|
|
|
|
vars:
|
|
|
|
sync_file: "{{ item }}"
|
|
|
|
sync_file_dir: "{{ etcd_cert_dir }}"
|
|
|
|
sync_file_hosts: "{{ etcd_node_cert_hosts }}"
|
|
|
|
sync_file_is_cert: true
|
|
|
|
with_items: "{{ etcd_node_cert_list|d([]) }}"
|
2017-06-24 11:26:47 +00:00
|
|
|
run_once: true
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- 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
|
2017-06-29 17:21:06 +00:00
|
|
|
run_once: true
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- name: sync_etcd_node_certs | Unset sync_file_results after etcd node certs
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|
|
|
|
|
|
|
|
- include: ../../vault/tasks/shared/sync_file.yml
|
|
|
|
vars:
|
|
|
|
sync_file: ca.pem
|
|
|
|
sync_file_dir: "{{ etcd_cert_dir }}"
|
2017-06-30 11:46:05 +00:00
|
|
|
sync_file_hosts: "{{ etcd_node_cert_hosts | unique }}"
|
2017-06-24 11:26:47 +00:00
|
|
|
run_once: true
|
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: []
|