34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
---
|
|
|
|
- name: cluster/sync_kube_node_certs | Create list of needed certs
|
|
set_fact:
|
|
vault_kube_node_cert_list: "{{ vault_kube_node_cert_list|default([]) + ['node-' + item + '.pem'] }}"
|
|
with_items: "{{ groups['k8s-cluster'] }}"
|
|
|
|
- include: ../sync_file.yml
|
|
vars:
|
|
sync_file: "{{ item }}"
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
sync_file_hosts: "{{ groups['k8s-cluster'] }}"
|
|
sync_file_is_cert: true
|
|
with_items: "{{ vault_kube_node_cert_list|default([]) }}"
|
|
|
|
- name: cluster/sync_kube_node_certs | Set facts for kube-master sync_file results
|
|
set_fact:
|
|
vault_kube_node_certs_needed: "{{ vault_kube_node_certs_needed|default([]) + [item.path] }}"
|
|
with_items: "{{ sync_file_results }}"
|
|
when: item.no_srcs|bool
|
|
|
|
- name: cluster/sync_kube_node_certs | Unset sync_file_results after kube node certs
|
|
set_fact:
|
|
sync_file_results: []
|
|
|
|
- include: ../sync_file.yml
|
|
vars:
|
|
sync_file: ca.pem
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
sync_file_hosts: "{{ groups['k8s-cluster'] }}"
|
|
|
|
- name: cluster/sync_kube_node_certs | Unset sync_file_results after ca.pem
|
|
set_fact:
|
|
sync_file_results: []
|