mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-08 11:07:43 +03:00
Copy ca-key.pem to etcd and kube-masters accordingly
This commit is contained in:
committed by
Matthew Mosesohn
parent
dfc46f02d7
commit
3fa7468d54
@@ -57,6 +57,7 @@
|
|||||||
gen_ca_mount_path: "{{ vault_pki_mounts.etcd.name }}"
|
gen_ca_mount_path: "{{ vault_pki_mounts.etcd.name }}"
|
||||||
gen_ca_vault_headers: "{{ vault_headers }}"
|
gen_ca_vault_headers: "{{ vault_headers }}"
|
||||||
gen_ca_vault_options: "{{ vault_ca_options.etcd }}"
|
gen_ca_vault_options: "{{ vault_ca_options.etcd }}"
|
||||||
|
gen_ca_copy_group: "etcd"
|
||||||
when: inventory_hostname in groups.etcd and vault_etcd_ca_cert_needed
|
when: inventory_hostname in groups.etcd and vault_etcd_ca_cert_needed
|
||||||
|
|
||||||
- import_tasks: gen_vault_certs.yml
|
- import_tasks: gen_vault_certs.yml
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
gen_ca_mount_path: "{{ vault_pki_mounts.kube.name }}"
|
gen_ca_mount_path: "{{ vault_pki_mounts.kube.name }}"
|
||||||
gen_ca_vault_headers: "{{ vault_headers }}"
|
gen_ca_vault_headers: "{{ vault_headers }}"
|
||||||
gen_ca_vault_options: "{{ vault_ca_options.kube }}"
|
gen_ca_vault_options: "{{ vault_ca_options.kube }}"
|
||||||
|
gen_ca_copy_group: "kube-master"
|
||||||
when: inventory_hostname in groups.vault
|
when: inventory_hostname in groups.vault
|
||||||
|
|
||||||
- include_tasks: ../shared/auth_backend.yml
|
- include_tasks: ../shared/auth_backend.yml
|
||||||
|
|||||||
@@ -24,9 +24,12 @@
|
|||||||
mode: 0644
|
mode: 0644
|
||||||
when: vault_ca_gen.status == 200
|
when: vault_ca_gen.status == 200
|
||||||
|
|
||||||
- name: "bootstrap/gen_ca | Copy {{ gen_ca_mount_path }} root CA key locally"
|
|
||||||
|
- name: "bootstrap/gen_ca | Copy {{ gen_ca_mount_path }} root CA key to necessary hosts"
|
||||||
copy:
|
copy:
|
||||||
content: "{{ hostvars[groups.vault|first]['vault_ca_gen']['json']['data']['private_key'] }}"
|
content: "{{ hostvars[groups.vault|first]['vault_ca_gen']['json']['data']['private_key'] }}"
|
||||||
dest: "{{ gen_ca_cert_dir }}/ca-key.pem"
|
dest: "{{ gen_ca_cert_dir }}/ca-key.pem"
|
||||||
mode: 0640
|
mode: 0640
|
||||||
when: vault_ca_gen.status == 200
|
when: vault_ca_gen.status == 200
|
||||||
|
delegate_to: "{{ item }}"
|
||||||
|
with_items: "{{ (groups[gen_ca_copy_group|default('vault')]) | union(groups['vault']) }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user