2017-01-14 04:31:10 +08:00
|
|
|
---
|
2017-02-09 05:41:36 +08:00
|
|
|
- include: ../shared/check_vault.yml
|
|
|
|
when: inventory_hostname in groups.vault
|
2017-02-18 05:22:34 +08:00
|
|
|
|
2017-02-09 05:41:36 +08:00
|
|
|
- include: sync_secrets.yml
|
2017-01-14 04:31:10 +08:00
|
|
|
when: inventory_hostname in groups.vault
|
2017-02-18 05:22:34 +08:00
|
|
|
|
2017-02-09 05:41:36 +08:00
|
|
|
- include: ../shared/find_leader.yml
|
2017-09-05 19:40:26 +08:00
|
|
|
when: inventory_hostname in groups.vault and vault_cluster_is_initialized
|
2017-01-14 04:31:10 +08:00
|
|
|
|
2017-02-09 05:41:36 +08:00
|
|
|
- include: sync_vault_certs.yml
|
|
|
|
when: inventory_hostname in groups.vault
|
2017-01-14 04:31:10 +08:00
|
|
|
|
2017-08-30 21:03:22 +08:00
|
|
|
- include: sync_etcd_certs.yml
|
|
|
|
when: inventory_hostname in groups.etcd
|
|
|
|
|
2017-02-09 05:41:36 +08:00
|
|
|
- include: start_vault_temp.yml
|
2017-09-02 03:51:37 +08:00
|
|
|
when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
|
2017-08-25 04:21:39 +08:00
|
|
|
|
2017-09-02 03:51:37 +08:00
|
|
|
- name: vault | Set fact about vault leader url
|
2017-08-25 04:21:39 +08:00
|
|
|
set_fact:
|
|
|
|
vault_leader_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
|
|
|
when: not vault_cluster_is_initialized
|
2017-01-14 04:31:10 +08:00
|
|
|
|
2017-09-02 03:51:37 +08:00
|
|
|
- include: create_mounts.yml
|
2017-08-30 21:03:22 +08:00
|
|
|
when: inventory_hostname == groups.vault|first
|
2017-01-14 04:31:10 +08:00
|
|
|
|
2017-09-02 03:51:37 +08:00
|
|
|
- include: ../shared/auth_backend.yml
|
2017-08-30 21:03:22 +08:00
|
|
|
vars:
|
2017-09-02 03:51:37 +08: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
|
|
|
|
when: inventory_hostname == groups.vault|first
|
2017-02-09 05:41:36 +08:00
|
|
|
|
2017-09-02 03:51:37 +08:00
|
|
|
- include: create_roles.yml
|
|
|
|
with_items:
|
|
|
|
- "{{ vault_pki_mounts.vault }}"
|
|
|
|
- "{{ vault_pki_mounts.etcd }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: mount
|
2017-09-05 16:05:06 +08:00
|
|
|
when: inventory_hostname in groups.vault
|
2017-01-14 04:31:10 +08:00
|
|
|
|
2017-09-02 03:51:37 +08:00
|
|
|
- include: ../shared/gen_ca.yml
|
2017-08-30 21:03:22 +08:00
|
|
|
vars:
|
2017-09-02 03:51:37 +08:00
|
|
|
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
|
2017-08-30 21:03:22 +08:00
|
|
|
|
|
|
|
- include: ../shared/gen_ca.yml
|
|
|
|
vars:
|
2017-09-02 03:51:37 +08:00
|
|
|
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 }}"
|
2017-08-30 21:03:22 +08:00
|
|
|
when: inventory_hostname in groups.etcd and vault_etcd_ca_cert_needed
|
2017-02-09 05:41:36 +08:00
|
|
|
|
2017-09-02 03:51:37 +08:00
|
|
|
- include: gen_vault_certs.yml
|
|
|
|
when: inventory_hostname in groups.vault and vault_api_cert_needed
|
2017-02-18 05:22:34 +08:00
|
|
|
|
2017-08-30 21:03:22 +08:00
|
|
|
- include: ca_trust.yml
|