bf0af1cd3d
* 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;
64 lines
2 KiB
YAML
64 lines
2 KiB
YAML
---
|
|
- include: ../shared/check_vault.yml
|
|
when: inventory_hostname in groups.vault
|
|
|
|
- include: sync_secrets.yml
|
|
when: inventory_hostname in groups.vault
|
|
|
|
- include: ../shared/find_leader.yml
|
|
when: inventory_hostname in groups.vault and vault_cluster_is_initialized|d()
|
|
|
|
- include: sync_vault_certs.yml
|
|
when: inventory_hostname in groups.vault
|
|
|
|
- include: sync_etcd_certs.yml
|
|
when: inventory_hostname in groups.etcd
|
|
|
|
- include: start_vault_temp.yml
|
|
when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
|
|
|
|
- name: vault | Set fact about vault leader url
|
|
set_fact:
|
|
vault_leader_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
|
when: not vault_cluster_is_initialized
|
|
|
|
- include: create_mounts.yml
|
|
when: inventory_hostname == groups.vault|first
|
|
|
|
- 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
|
|
with_items:
|
|
- "{{ vault_pki_mounts.vault }}"
|
|
- "{{ vault_pki_mounts.etcd }}"
|
|
loop_control:
|
|
loop_var: mount
|
|
|
|
- include: ../shared/gen_ca.yml
|
|
vars:
|
|
gen_ca_cert_dir: "{{ vault_pki_mounts.vault.cert_dir }}"
|
|
gen_ca_mount_path: "{{ vault_pki_mounts.vault.name }}"
|
|
gen_ca_vault_headers: "{{ vault_headers }}"
|
|
gen_ca_vault_options: "{{ vault_ca_options.vault }}"
|
|
when: >-
|
|
inventory_hostname in groups.vault
|
|
and not vault_cluster_is_initialized
|
|
and vault_ca_cert_needed
|
|
|
|
- include: ../shared/gen_ca.yml
|
|
vars:
|
|
gen_ca_cert_dir: "{{ vault_pki_mounts.etcd.cert_dir }}"
|
|
gen_ca_mount_path: "{{ vault_pki_mounts.etcd.name }}"
|
|
gen_ca_vault_headers: "{{ vault_headers }}"
|
|
gen_ca_vault_options: "{{ vault_ca_options.etcd }}"
|
|
when: inventory_hostname in groups.etcd and vault_etcd_ca_cert_needed
|
|
|
|
- include: gen_vault_certs.yml
|
|
when: inventory_hostname in groups.vault and vault_api_cert_needed
|
|
|
|
- include: ca_trust.yml
|