2017-02-08 21:41:36 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: sync_kube_master_certs | Create list of needed kube admin certs
|
|
|
|
set_fact:
|
2017-09-14 11:28:11 +00:00
|
|
|
kube_admin_cert_list: "{{ kube_admin_cert_list|d([]) + ['admin-' + 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-04-26 12:11:13 +00:00
|
|
|
vars:
|
2017-02-08 21:41:36 +00:00
|
|
|
sync_file: "{{ item }}"
|
|
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
|
|
sync_file_group: "{{ kube_cert_group }}"
|
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
|
|
|
|
sync_file_owner: kube
|
2017-09-01 19:51:37 +00:00
|
|
|
with_items: "{{ kube_admin_cert_list|d([]) }}"
|
2017-02-08 21:41:36 +00:00
|
|
|
|
|
|
|
- name: sync_kube_master_certs | Set facts for kube admin sync_file results
|
|
|
|
set_fact:
|
2017-09-01 19:51:37 +00:00
|
|
|
kube_admin_certs_needed: "{{ kube_admin_certs_needed|default([]) + [item.path] }}"
|
2017-02-08 21:41:36 +00:00
|
|
|
with_items: "{{ sync_file_results|d([]) }}"
|
|
|
|
when: item.no_srcs|bool
|
|
|
|
|
|
|
|
- name: sync_kube_master_certs | Unset sync_file_results after kube admin certs
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
2017-02-08 21:41:36 +00:00
|
|
|
vars:
|
2017-08-20 10:53:58 +00:00
|
|
|
sync_file: "{{ item }}"
|
2017-02-08 21:41:36 +00:00
|
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
|
|
sync_file_group: "{{ kube_cert_group }}"
|
|
|
|
sync_file_hosts: "{{ groups['kube-master'] }}"
|
|
|
|
sync_file_is_cert: true
|
|
|
|
sync_file_owner: kube
|
2018-02-05 09:37:36 +00:00
|
|
|
with_items: ["apiserver.pem", "kube-scheduler.pem", "kube-controller-manager.pem", "aggregator-proxy-client.pem"]
|
2017-02-08 21:41:36 +00:00
|
|
|
|
2017-08-20 10:53:58 +00:00
|
|
|
- name: sync_kube_master_certs | Set facts for kube master components sync_file results
|
2017-02-08 21:41:36 +00:00
|
|
|
set_fact:
|
2017-08-20 10:53:58 +00:00
|
|
|
kube_master_components_certs_needed: "{{ kube_master_components_certs_needed|d([]) + [item.path] }}"
|
2017-02-08 21:41:36 +00:00
|
|
|
with_items: "{{ sync_file_results|d([]) }}"
|
2017-08-20 10:53:58 +00:00
|
|
|
when: item.no_srcs|bool
|
2017-02-08 21:41:36 +00:00
|
|
|
|
2017-08-20 10:53:58 +00:00
|
|
|
- name: sync_kube_master_certs | Unset sync_file_results after kube master components cert
|
2017-02-08 21:41:36 +00:00
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
2017-04-26 12:11:13 +00:00
|
|
|
vars:
|
2017-02-08 21:41:36 +00:00
|
|
|
sync_file: ca.pem
|
|
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
|
|
sync_file_group: "{{ kube_cert_group }}"
|
|
|
|
sync_file_hosts: "{{ groups['kube-master'] }}"
|
|
|
|
sync_file_owner: kube
|
|
|
|
|
|
|
|
- name: sync_kube_master_certs | Unset sync_file_results after ca.pem
|
|
|
|
set_fact:
|
|
|
|
sync_file_results: []
|