---

- name: Start and enable vault service
  service: name=vault state=started enabled=True
  register: vault_service_started
  tags: vault

- name: Handle consul-template-vault service
  service:
    name: consul-template-vault
    state: "{{ vault_secrets.nomad.enabled | ternary('started', 'stopped') }}"
    enabled: "{{ vault_secrets.nomad.enabled | ternary(True, False) }}"
  tags: vault
