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.

19 lines
643 B

  1. ---
  2. - name: check_etcd | Check if etcd is up an reachable
  3. uri:
  4. url: "{{ vault_etcd_url }}/health"
  5. validate_certs: no
  6. failed_when: false
  7. register: vault_etcd_health_check
  8. - name: check_etcd | Set fact based off the etcd_health_check response
  9. set_fact:
  10. vault_etcd_available: "{{ vault_etcd_health_check.get('json', {}).get('health')|bool }}"
  11. - name: check_etcd | Fail if etcd is not available and needed
  12. fail:
  13. msg: >
  14. Unable to start Vault cluster! Etcd is not available at
  15. {{ vault_etcd_url }} however it is needed by Vault as a backend.
  16. when: vault_etcd_needed|d() and not vault_etcd_available