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 ]]
|
2022-09-04 19:00:20 +02:00
|
|
|
{% if item.what == 'certificate' %}
|
|
|
|
[[ with secret "{{ consul_vault_tls.pki.path }}/cert/ca" ]]
|
|
|
|
[[ .Data.certificate ]]
|
|
|
|
[[ end ]]
|
|
|
|
{% endif %}
|
2022-09-04 14:00:17 +02:00
|
|
|
{% else %}
|
|
|
|
[[ with secret "{{ consul_vault_tls.pki.path }}/cert/ca" ]]
|
|
|
|
[[ .Data.certificate ]]
|
|
|
|
[[ end ]]
|
|
|
|
{% endif %}
|