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.

28 lines
925 B

  1. ---
  2. - name: boostrap/gen_vault_certs | Add the vault role
  3. uri:
  4. url: "{{ vault_leader_url }}/v1/pki/roles/vault"
  5. headers: "{{ vault_headers }}"
  6. method: POST
  7. body_format: json
  8. body: "{{ vault_default_role_permissions }}"
  9. status_code: 204
  10. when: inventory_hostname == groups.vault|first and vault_api_cert_needed
  11. - include: ../shared/issue_cert.yml
  12. vars:
  13. issue_cert_alt_names: "{{ groups.vault + ['localhost'] }}"
  14. issue_cert_hosts: "{{ groups.vault }}"
  15. issue_cert_ip_sans: >-
  16. [
  17. {%- for host in groups.vault -%}
  18. "{{ hostvars[host]['ansible_default_ipv4']['address'] }}",
  19. {%- endfor -%}
  20. "127.0.0.1","::1"
  21. ]
  22. issue_cert_path: "{{ vault_cert_dir }}/api.pem"
  23. issue_cert_headers: "{{ hostvars[groups.vault|first]['vault_headers'] }}"
  24. issue_cert_role: vault
  25. issue_cert_url: "{{ vault_leader_url }}"
  26. when: vault_api_cert_needed