2017-01-13 20:31:10 +00:00
|
|
|
---
|
2018-05-11 16:11:38 +00:00
|
|
|
- import_tasks: ../shared/check_etcd.yml
|
|
|
|
vars:
|
|
|
|
vault_etcd_needed: no
|
|
|
|
when: inventory_hostname in groups.vault
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: ../shared/check_vault.yml
|
2017-02-08 21:41:36 +00:00
|
|
|
when: inventory_hostname in groups.vault
|
2017-02-17 21:22:34 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: sync_secrets.yml
|
2017-01-13 20:31:10 +00:00
|
|
|
when: inventory_hostname in groups.vault
|
2017-02-17 21:22:34 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: ../shared/find_leader.yml
|
2017-09-05 11:40:26 +00:00
|
|
|
when: inventory_hostname in groups.vault and vault_cluster_is_initialized
|
2017-01-13 20:31:10 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: sync_vault_certs.yml
|
2017-02-08 21:41:36 +00:00
|
|
|
when: inventory_hostname in groups.vault
|
2017-01-13 20:31:10 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: sync_etcd_certs.yml
|
2017-08-30 13:03:22 +00:00
|
|
|
when: inventory_hostname in groups.etcd
|
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: start_vault_temp.yml
|
2017-09-01 19:51:37 +00:00
|
|
|
when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
|
2017-08-24 20:21:39 +00:00
|
|
|
|
2017-09-01 19:51:37 +00:00
|
|
|
- name: vault | Set fact about vault leader url
|
2017-08-24 20:21:39 +00:00
|
|
|
set_fact:
|
|
|
|
vault_leader_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
|
|
|
when: not vault_cluster_is_initialized
|
2017-01-13 20:31:10 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: create_mounts.yml
|
2018-05-11 16:11:38 +00:00
|
|
|
when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
|
2017-01-13 20:31:10 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../shared/auth_backend.yml
|
2017-08-30 13:03:22 +00:00
|
|
|
vars:
|
2017-09-01 19:51:37 +00:00
|
|
|
auth_backend_description: A Username/Password Auth Backend primarily used for services needing to issue certificates
|
|
|
|
auth_backend_path: userpass
|
|
|
|
auth_backend_type: userpass
|
2018-05-11 16:11:38 +00:00
|
|
|
when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
|
2017-02-08 21:41:36 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: create_roles.yml
|
2017-09-01 19:51:37 +00:00
|
|
|
with_items:
|
|
|
|
- "{{ vault_pki_mounts.vault }}"
|
|
|
|
- "{{ vault_pki_mounts.etcd }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: mount
|
2018-05-11 16:11:38 +00:00
|
|
|
when: inventory_hostname in groups.vault and not vault_cluster_is_initialized
|
2017-01-13 20:31:10 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../shared/gen_ca.yml
|
2017-08-30 13:03:22 +00:00
|
|
|
vars:
|
2017-09-01 19:51:37 +00:00
|
|
|
gen_ca_cert_dir: "{{ vault_pki_mounts.vault.cert_dir }}"
|
2018-05-11 16:11:38 +00:00
|
|
|
gen_ca_mount_path: "/{{ vault_pki_mounts.vault.name }}"
|
2017-09-01 19:51:37 +00:00
|
|
|
gen_ca_vault_headers: "{{ vault_headers }}"
|
|
|
|
gen_ca_vault_options: "{{ vault_ca_options.vault }}"
|
2018-05-11 16:11:38 +00:00
|
|
|
gen_ca_copy_group: "kube-master"
|
2017-09-01 19:51:37 +00:00
|
|
|
when: >-
|
|
|
|
inventory_hostname in groups.vault
|
|
|
|
and not vault_cluster_is_initialized
|
|
|
|
and vault_ca_cert_needed
|
2017-08-30 13:03:22 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: ../shared/gen_ca.yml
|
2017-08-30 13:03:22 +00:00
|
|
|
vars:
|
2017-09-01 19:51:37 +00:00
|
|
|
gen_ca_cert_dir: "{{ vault_pki_mounts.etcd.cert_dir }}"
|
2018-05-11 16:11:38 +00:00
|
|
|
gen_ca_mount_path: "/{{ vault_pki_mounts.etcd.name }}"
|
2017-09-01 19:51:37 +00:00
|
|
|
gen_ca_vault_headers: "{{ vault_headers }}"
|
|
|
|
gen_ca_vault_options: "{{ vault_ca_options.etcd }}"
|
2018-04-10 16:55:28 +00:00
|
|
|
gen_ca_copy_group: "etcd"
|
2018-05-11 16:11:38 +00:00
|
|
|
when: inventory_hostname in groups.etcd and not vault_cluster_is_initialized and vault_etcd_ca_cert_needed
|
2017-02-08 21:41:36 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: gen_vault_certs.yml
|
2018-05-11 16:11:38 +00:00
|
|
|
when: inventory_hostname in groups.vault and not vault_cluster_is_initialized and vault_api_cert_needed
|
2017-02-17 21:22:34 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- import_tasks: ca_trust.yml
|