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.2 KiB

  1. ---
  2. - import_tasks: ../shared/check_vault.yml
  3. when: inventory_hostname in groups.vault
  4. - import_tasks: sync_secrets.yml
  5. when: inventory_hostname in groups.vault
  6. - import_tasks: ../shared/find_leader.yml
  7. when: inventory_hostname in groups.vault and vault_cluster_is_initialized
  8. - import_tasks: sync_vault_certs.yml
  9. when: inventory_hostname in groups.vault
  10. - import_tasks: sync_etcd_certs.yml
  11. when: inventory_hostname in groups.etcd
  12. - import_tasks: 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. - import_tasks: create_mounts.yml
  19. when: inventory_hostname == groups.vault|first
  20. - include_tasks: ../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_tasks: 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_tasks: ../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_tasks: ../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. - import_tasks: gen_vault_certs.yml
  51. when: inventory_hostname in groups.vault and vault_api_cert_needed
  52. - import_tasks: ca_trust.yml