mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-14 04:47:49 -02:30
Vault role updates:
* using separated vault roles for generate certs with different `O` (Organization) subject field; * configure vault roles for issuing certificates with different `CN` (Common name) subject field; * set `CN` and `O` to `kubernetes` and `etcd` certificates; * vault/defaults vars definition was simplified; * vault dirs variables defined in kubernetes-defaults foles for using shared tasks in etcd and kubernetes/secrets roles; * upgrade vault to 0.8.1; * generate random vault user password for each role by default; * fix `serial` file name for vault certs; * move vault auth request to issue_cert tasks; * enable `RBAC` in vault CI;
This commit is contained in:
13
roles/vault/tasks/cluster/create_mounts.yml
Normal file
13
roles/vault/tasks/cluster/create_mounts.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- include: ../shared/create_mount.yml
|
||||
vars:
|
||||
create_mount_path: "{{ item.name }}"
|
||||
create_mount_default_lease_ttl: "{{ item.default_lease_ttl }}"
|
||||
create_mount_max_lease_ttl: "{{ item.max_lease_ttl }}"
|
||||
create_mount_description: "{{ item.description }}"
|
||||
create_mount_cert_dir: "{{ item.cert_dir }}"
|
||||
create_mount_config_ca_needed: "{{ item.name != vault_pki_mounts.kube.name }}"
|
||||
with_items:
|
||||
- "{{ vault_pki_mounts.vault }}"
|
||||
- "{{ vault_pki_mounts.etcd }}"
|
||||
- "{{ vault_pki_mounts.kube }}"
|
||||
@@ -1,18 +1,10 @@
|
||||
---
|
||||
- include: ../shared/auth_backend.yml
|
||||
vars:
|
||||
auth_backend_description: A Username/Password Auth Backend primarily used for services needing to issue certificates
|
||||
auth_backend_path: userpass
|
||||
auth_backend_type: userpass
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: ../shared/create_role.yml
|
||||
vars:
|
||||
create_role_name: "{{ item.name }}"
|
||||
create_role_group: "{{ item.group }}"
|
||||
create_role_password: "{{ item.password }}"
|
||||
create_role_policy_rules: "{{ item.policy_rules }}"
|
||||
create_role_options: "{{ item.role_options }}"
|
||||
create_role_mount_path: "{{ item.mount_path }}"
|
||||
with_items:
|
||||
- "{{ vault_etcd_role }}"
|
||||
- "{{ vault_kube_role }}"
|
||||
create_role_mount_path: "{{ vault_pki_mounts.kube.name }}"
|
||||
with_items: "{{ vault_pki_mounts.kube.roles }}"
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
- include: ../shared/check_etcd.yml
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
## Vault Cluster Setup
|
||||
|
||||
- include: configure.yml
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
@@ -25,42 +23,22 @@
|
||||
- include: ../shared/find_leader.yml
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
- include: ../shared/create_mount.yml
|
||||
vars:
|
||||
create_mount_path: "{{ vault_ca_options.common_name }}"
|
||||
create_mount_default_lease_ttl: "{{ vault_default_lease_ttl }}"
|
||||
create_mount_max_lease_ttl: "{{ vault_max_lease_ttl }}"
|
||||
create_mount_description: "Vault Root CA"
|
||||
create_mount_cert_dir: "{{ vault_cert_dir }}"
|
||||
create_mount_config_ca_needed: true
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: ../shared/create_mount.yml
|
||||
vars:
|
||||
create_mount_path: "{{ vault_etcd_mount_path }}"
|
||||
create_mount_default_lease_ttl: "{{ vault_etcd_default_lease_ttl }}"
|
||||
create_mount_max_lease_ttl: "{{ vault_etcd_max_lease_ttl }}"
|
||||
create_mount_description: "Etcd Root CA"
|
||||
create_mount_cert_dir: "{{ vault_etcd_cert_dir }}"
|
||||
create_mount_config_ca_needed: true
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: ../shared/create_mount.yml
|
||||
vars:
|
||||
create_mount_path: "{{ vault_kube_mount_path }}"
|
||||
create_mount_default_lease_ttl: "{{ vault_kube_default_lease_ttl }}"
|
||||
create_mount_max_lease_ttl: "{{ vault_kube_max_lease_ttl }}"
|
||||
create_mount_description: "Kubernetes Root CA"
|
||||
create_mount_cert_dir: "{{ vault_kube_cert_dir }}"
|
||||
create_mount_config_ca_needed: false
|
||||
- include: create_mounts.yml
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: ../shared/gen_ca.yml
|
||||
vars:
|
||||
gen_ca_cert_dir: "{{ vault_kube_cert_dir }}"
|
||||
gen_ca_mount_path: "{{ vault_kube_mount_path }}"
|
||||
gen_ca_cert_dir: "{{ vault_pki_mounts.kube.cert_dir }}"
|
||||
gen_ca_mount_path: "{{ vault_pki_mounts.kube.name }}"
|
||||
gen_ca_vault_headers: "{{ vault_headers }}"
|
||||
gen_ca_vault_options: "{{ vault_ca_options.kube }}"
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
## Vault Policies, Roles, and Auth Backends
|
||||
- include: ../shared/auth_backend.yml
|
||||
vars:
|
||||
auth_backend_description: A Username/Password Auth Backend primarily used for services needing to issue certificates
|
||||
auth_backend_path: userpass
|
||||
auth_backend_type: userpass
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: create_roles.yml
|
||||
|
||||
Reference in New Issue
Block a user