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.

45 lines
1.2 KiB

  1. ---
  2. - name: cluster/systemd | Ensure mount points exist prior to vault.service startup
  3. file:
  4. mode: 0750
  5. path: "{{ item }}"
  6. state: directory
  7. with_items:
  8. - "{{ vault_config_dir }}"
  9. - "{{ vault_log_dir }}"
  10. - "{{ vault_secrets_dir }}"
  11. - /var/lib/vault/
  12. - name: cluster/systemd | Ensure the vault user has access to needed directories
  13. file:
  14. owner: vault
  15. path: "{{ item }}"
  16. recurse: true
  17. with_items:
  18. - "{{ vault_base_dir }}"
  19. - "{{ vault_log_dir }}"
  20. - /var/lib/vault
  21. - name: cluster/systemd | Copy down vault.service systemd file
  22. template:
  23. src: "{{ vault_deployment_type }}.service.j2"
  24. dest: /etc/systemd/system/vault.service
  25. backup: yes
  26. register: vault_systemd_placement
  27. - name: cluster/systemd | Enable vault.service
  28. systemd:
  29. daemon_reload: true
  30. enabled: yes
  31. name: vault
  32. state: started
  33. - name: cluster/systemd | Query local vault until service is up
  34. uri:
  35. url: "{{ vault_config.listener.tcp.tls_disable|d()|ternary('http', 'https') }}://localhost:{{ vault_port }}/v1/sys/health"
  36. headers: "{{ vault_client_headers }}"
  37. status_code: 200,429,500,501
  38. register: vault_health_check
  39. until: vault_health_check|succeeded
  40. retries: 10