mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-16 22:07:39 -02:30
Vault security hardening and role isolation
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
---
|
||||
|
||||
- name: trust_ca | pull CA from cert from groups.vault|first
|
||||
- name: bootstrap/ca_trust | pull CA from cert from groups.vault|first
|
||||
command: "cat {{ vault_cert_dir }}/ca.pem"
|
||||
register: vault_cert_file_cat
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
# This part is mostly stolen from the etcd role
|
||||
- name: trust_ca | target ca-certificate store file
|
||||
- name: bootstrap/ca_trust | target ca-certificate store file
|
||||
set_fact:
|
||||
ca_cert_path: >-
|
||||
{% if ansible_os_family == "Debian" -%}
|
||||
@@ -17,16 +17,16 @@
|
||||
/etc/ssl/certs/kube-cluster-ca.pem
|
||||
{%- endif %}
|
||||
|
||||
- name: trust_ca | add CA to trusted CA dir
|
||||
- name: bootstrap/ca_trust | add CA to trusted CA dir
|
||||
copy:
|
||||
content: "{{ hostvars[groups.vault|first]['vault_cert_file_cat']['stdout'] }}"
|
||||
dest: "{{ ca_cert_path }}"
|
||||
register: vault_ca_cert
|
||||
|
||||
- name: trust_ca | update ca-certificates (Debian/Ubuntu/CoreOS)
|
||||
- name: bootstrap/ca_trust | update ca-certificates (Debian/Ubuntu/CoreOS)
|
||||
command: update-ca-certificates
|
||||
when: vault_ca_cert.changed and ansible_os_family in ["Debian", "CoreOS"]
|
||||
|
||||
- name: trust_ca | update ca-certificates (RedHat)
|
||||
- name: bootstrap/ca_trust | update ca-certificates (RedHat)
|
||||
command: update-ca-trust extract
|
||||
when: vault_ca_cert.changed and ansible_os_family == "RedHat"
|
||||
|
||||
Reference in New Issue
Block a user