ansible-roles/roles/consul/templates/agent_cert.tpl.j2

10 lines
649 B
Plaintext
Raw Normal View History

2022-09-04 14:00:17 +02:00
{% if consul_conf.server %}
2022-09-04 18:00:17 +02:00
[[ with secret "{{ consul_vault_tls.pki.path }}/issue/{{ consul_vault_tls.pki.role }}" "common_name=server-{{ ansible_fqdn | regex_replace('\\.', '-') }}.{{ consul_conf.datacenter | default('dc1') }}.{{ consul_conf.domain | default('consul') }}" "ttl={{ consul_vault_tls.pki.ttl }}" "alt_names=localhost,consul.service.{{ consul_conf.domain | default('consul') }},server.{{ consul_conf.datacenter | default('dc1') }}.{{ consul_conf.domain | default('consul') }}" ]]
2022-09-04 14:00:17 +02:00
[[ .Data.{{ item.what }} ]]
[[ end ]]
{% else %}
[[ with secret "{{ consul_vault_tls.pki.path }}/cert/ca" ]]
[[ .Data.certificate ]]
[[ end ]]
{% endif %}