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.

58 lines
1.5 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|d()
  8. ## Sync Certs
  9. - include: sync_vault_certs.yml
  10. when: inventory_hostname in groups.vault
  11. ## Generate Certs
  12. # Start a temporary instance of Vault
  13. - include: start_vault_temp.yml
  14. when: >-
  15. inventory_hostname == groups.vault|first and
  16. not vault_cluster_is_initialized
  17. # NOTE: The next 2 steps run against temp Vault and long-term Vault
  18. # Ensure PKI mount exists
  19. - include: ../shared/pki_mount.yml
  20. when: >-
  21. inventory_hostname == groups.vault|first
  22. # If the Root CA already exists, ensure Vault's PKI is using it
  23. - include: ../shared/config_ca.yml
  24. vars:
  25. ca_name: ca
  26. mount_name: pki
  27. when: >-
  28. inventory_hostname == groups.vault|first and
  29. not vault_ca_cert_needed
  30. # Generate root CA certs for Vault if none exist
  31. - include: gen_ca.yml
  32. when: >-
  33. inventory_hostname in groups.vault and
  34. not vault_cluster_is_initialized and
  35. vault_ca_cert_needed
  36. # Generate Vault API certs
  37. - include: gen_vault_certs.yml
  38. when: inventory_hostname in groups.vault and vault_api_cert_needed
  39. # Update all host's CA bundle
  40. - include: ca_trust.yml
  41. ## Add Etcd Role to Vault (if needed)
  42. - include: role_auth_cert.yml
  43. when: vault_role_auth_method == "cert"
  44. - include: role_auth_userpass.yml
  45. when: vault_role_auth_method == "userpass"