2017-02-08 21:41:36 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: sync_etcd_master_certs | Create list of master certs needing creation
|
|
|
|
set_fact:
|
|
|
|
etcd_master_cert_list: >-
|
|
|
|
{{ etcd_master_cert_list|default([]) + [
|
|
|
|
"admin-" + item + ".pem",
|
|
|
|
"member-" + item + ".pem"
|
|
|
|
] }}
|
|
|
|
with_items: "{{ groups.etcd }}"
|
2017-07-27 17:46:21 +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: "{{ groups.etcd }}"
|
|
|
|
sync_file_is_cert: true
|
|
|
|
with_items: "{{ etcd_master_cert_list|d([]) }}"
|
2017-07-27 17:46:21 +00:00
|
|
|
run_once: true
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- name: sync_etcd_certs | Set facts for etcd sync_file results
|
|
|
|
set_fact:
|
|
|
|
etcd_master_certs_needed: "{{ etcd_master_certs_needed|default([]) + [item.path] }}"
|
|
|
|
with_items: "{{ sync_file_results|d([]) }}"
|
|
|
|
when: item.no_srcs|bool
|
|
|
|
|
|
|
|
- name: sync_etcd_certs | Unset sync_file_results after etcd certs sync
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|
|
|
|
|
|
|
|
- include: ../../vault/tasks/shared/sync_file.yml
|
|
|
|
vars:
|
|
|
|
sync_file: ca.pem
|
|
|
|
sync_file_dir: "{{ etcd_cert_dir }}"
|
|
|
|
sync_file_hosts: "{{ groups.etcd }}"
|
2017-07-27 17:46:21 +00:00
|
|
|
run_once: true
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- name: sync_etcd_certs | Unset sync_file_results after ca.pem sync
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|