You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- name: "Check_certs | Set 'gen_node_certs' object to track which nodes needs to have certs generated on first etcd node"
99
+
set_fact:
100
+
gen_node_certs: |-
101
+
{
102
+
{% set k8s_nodes = groups['k8s_cluster'] -%}
103
+
{% set existing_certs = etcdcert_master.files | map(attribute='path') | list | sort %}
104
+
{% for host in k8s_nodes -%}
105
+
{% set host_cert = "%s/node-%s.pem" | format(etcd_cert_dir, host) %}
106
+
{% set host_key = "%s/node-%s-key.pem" | format(etcd_cert_dir, host) %}
107
+
{% if force_etcd_cert_refresh -%}
108
+
"{{ host }}"{% if not loop.last %},{% endif %}
109
+
{% elif host_cert not in existing_certs and host_key not in existing_certs -%}
110
+
"{{ host }}"{% if not loop.last %},{% endif %}
111
+
{% endif -%}
112
+
{% endfor %}
113
+
}
114
+
run_once: true
115
+
116
+
- name: "Check_certs | Add gen_node_certs object into 'gen_node_certs_True' group on first etcd node"
117
+
ansible.builtin.add_host:
118
+
name: "{{ item }}"
119
+
groups: gen_node_certs_True
120
+
with_items: "{{ gen_node_certs }}"
121
+
run_once: true
122
+
when: gen_node_certs | length > 0
123
+
98
124
- name: "Check_certs | Set 'etcd_member_requires_sync' to true if ca or member/admin cert and key don't exist on etcd member or checksum doesn't match"
0 commit comments