mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-02 06:45:43 +02:00
Update to 2023-07-08 16:00
This commit is contained in:
13
roles/vault_agent/templates/consul/agent_bundle.pem.tpl.j2
Normal file
13
roles/vault_agent/templates/consul/agent_bundle.pem.tpl.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
{% if consul_conf.server %}
|
||||
[[ with pkiCert "{{ vault_agent_consul.consul_pki.path }}/issue/{{ vault_agent_consul.consul_pki.role }}" "common_name=server-{{ ansible_fqdn | regex_replace('\\.', '-') }}.{{ consul_conf.datacenter | default('dc1') }}.{{ consul_conf.domain | default('consul') }}" "alt_names=consul.service.{{ consul_conf.domain | default('consul') }},server.{{ consul_conf.datacenter | default('dc1') }}.{{ consul_conf.domain | default('consul') }}{% if consul_conf.alt_domain is defined %},consul.service.{{ consul_conf.alt_domain }},server.{{ consul_conf.datacenter | default('dc1') }}.{{ consul_conf.alt_domain }}{% endif %}"{% if vault_agent_consul.consul_pki.ttl is defined %} "ttl={{ vault_agent_consul.consul_pki.ttl }}"{% endif %} ]]
|
||||
[[ .CA ]]
|
||||
[[ .Cert ]]
|
||||
[[ .Key ]]
|
||||
[[ .Cert | writeToFile "{{ consul_conf.tls.defaults.cert_file }}" "root" "{{ consul_user }}" "0644" ]]
|
||||
[[ .Key | writeToFile "{{ consul_conf.tls.defaults.key_file }}" "root" "{{ consul_user }}" "0640" ]]
|
||||
[[ end ]]
|
||||
{% else %}
|
||||
[[ with secret "{{ vault_agent_consul.consul_pki.path }}/cert/ca_chain" ]]
|
||||
[[ .Data.certificate | writeToFile "{{ consul_conf.tls.defaults.ca_file }}" "root" "{{ consul_user }}" "0644" ]]
|
||||
[[ end ]]
|
||||
{% endif %}
|
12
roles/vault_agent/templates/consul/consul.hcl.j2
Normal file
12
roles/vault_agent/templates/consul/consul.hcl.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
{% if vault_agent_consul.consul_pki.enabled %}
|
||||
template {
|
||||
source = "{{ vault_agent_root_dir }}/templates/consul/agent_bundle.pem.tpl"
|
||||
destination = "{{ consul_root_dir }}/tls/agent_bundle.pem"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
perms = 0640
|
||||
exec {
|
||||
command = ["systemctl", "reload", "consul"]
|
||||
}
|
||||
}
|
||||
{% endif %}
|
Reference in New Issue
Block a user