You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.1 KiB

  1. ---
  2. - include: ../shared/check_vault.yml
  3. when: inventory_hostname in groups.vault
  4. - include: sync_secrets.yml
  5. when: inventory_hostname in groups.vault
  6. - include: ../shared/find_leader.yml
  7. when: inventory_hostname in groups.vault and vault_cluster_is_initialized
  8. - include: sync_vault_certs.yml
  9. when: inventory_hostname in groups.vault
  10. - include: sync_etcd_certs.yml
  11. when: inventory_hostname in groups.etcd
  12. - include: start_vault_temp.yml
  13. when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
  14. - name: vault | Set fact about vault leader url
  15. set_fact:
  16. vault_leader_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
  17. when: not vault_cluster_is_initialized
  18. - include: create_mounts.yml
  19. when: inventory_hostname == groups.vault|first
  20. - include: ../shared/auth_backend.yml
  21. vars:
  22. auth_backend_description: A Username/Password Auth Backend primarily used for services needing to issue certificates
  23. auth_backend_path: userpass
  24. auth_backend_type: userpass
  25. when: inventory_hostname == groups.vault|first
  26. - include: create_roles.yml
  27. with_items:
  28. - "{{ vault_pki_mounts.vault }}"
  29. - "{{ vault_pki_mounts.etcd }}"
  30. loop_control:
  31. loop_var: mount
  32. when: inventory_hostname in groups.vault
  33. - include: ../shared/gen_ca.yml
  34. vars:
  35. gen_ca_cert_dir: "{{ vault_pki_mounts.vault.cert_dir }}"
  36. gen_ca_mount_path: "{{ vault_pki_mounts.vault.name }}"
  37. gen_ca_vault_headers: "{{ vault_headers }}"
  38. gen_ca_vault_options: "{{ vault_ca_options.vault }}"
  39. when: >-
  40. inventory_hostname in groups.vault
  41. and not vault_cluster_is_initialized
  42. and vault_ca_cert_needed
  43. - include: ../shared/gen_ca.yml
  44. vars:
  45. gen_ca_cert_dir: "{{ vault_pki_mounts.etcd.cert_dir }}"
  46. gen_ca_mount_path: "{{ vault_pki_mounts.etcd.name }}"
  47. gen_ca_vault_headers: "{{ vault_headers }}"
  48. gen_ca_vault_options: "{{ vault_ca_options.etcd }}"
  49. when: inventory_hostname in groups.etcd and vault_etcd_ca_cert_needed
  50. - include: gen_vault_certs.yml
  51. when: inventory_hostname in groups.vault and vault_api_cert_needed
  52. - include: ca_trust.yml