mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-06 18:17:47 +03:00
Vault security hardening and role isolation
This commit is contained in:
21
roles/vault/tasks/bootstrap/gen_auth_ca.yml
Normal file
21
roles/vault/tasks/bootstrap/gen_auth_ca.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
|
||||
- name: bootstrap/gen_auth_ca | Generate Root CA
|
||||
uri:
|
||||
url: "{{ vault_leader_url }}/v1/auth-pki/root/generate/exported"
|
||||
headers: "{{ vault_headers }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body: "{{ vault_ca_options }}"
|
||||
register: vault_auth_ca_gen
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- name: bootstrap/gen_auth_ca | Copy auth CA cert to Vault nodes
|
||||
copy:
|
||||
content: "{{ hostvars[groups.vault|first]['vault_auth_ca_gen']['json']['data']['certificate'] }}"
|
||||
dest: "{{ vault_cert_dir }}/auth-ca.pem"
|
||||
|
||||
- name: bootstrap/gen_auth_ca | Copy auth CA key to Vault nodes
|
||||
copy:
|
||||
content: "{{ hostvars[groups.vault|first]['vault_auth_ca_gen']['json']['data']['private_key'] }}"
|
||||
dest: "{{ vault_cert_dir }}/auth-ca-key.pem"
|
||||
Reference in New Issue
Block a user