mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-04 07:37:20 +02:00
Update to 2022-09-13 17:00
This commit is contained in:
11
roles/nomad/templates/agent_bundle.pem.tpl.j2
Normal file
11
roles/nomad/templates/agent_bundle.pem.tpl.j2
Normal file
@@ -0,0 +1,11 @@
|
||||
[[ with pkiCert "{{ nomad_vault_secrets.pki.path }}/issue/{{ nomad_vault_secrets.pki.role }}" "common_name={{ (nomad_conf.server.enabled) | ternary('server', 'client') }}-{{ ansible_fqdn | regex_replace('\\.', '-') }}.{{ nomad_conf.region | default('global') }}.nomad" "alt_names=localhost,{{ (nomad_conf.server.enabled) | ternary('server', 'client') }}.{{ nomad_conf.region | default('global') }}.nomad{% if nomad_conf.server.enabled and nomad_conf.client.enabled %},client.{{ nomad_conf.region | default('global') }}.nomad{% endif %}{% if consul_conf is defined %},nomad{{ nomad_conf.server.enabled | ternary('', '-client') }}.service.{{ consul_conf.domain | default('consul') }}{% endif %}"{% if nomad_vault_secrets.pki.ttl is defined %} "ttl={{ nomad_vault_secrets.pki.ttl }}"{% endif %} ]]
|
||||
[[ .CA ]]
|
||||
[[ .Cert ]]
|
||||
[[ .Key ]]
|
||||
[[ .CA | writeToFile "{{ nomad_conf.tls.ca_file }}" "root" "root" "0644" ]]
|
||||
[[ .Cert | writeToFile "{{ nomad_conf.tls.cert_file }}" "root" "root" "0644" ]]
|
||||
[[ .Key | writeToFile "{{ nomad_conf.tls.key_file }}" "root" "{{ nomad_user }}" "0640" ]]
|
||||
[[ end ]]
|
||||
[[ with secret "{{ nomad_vault_secrets.pki.path }}/cert/ca" ]]
|
||||
[[ .Data.certificate | writeToFile "{{ nomad_conf.tls.cert_file }}" "" "" "0644" "append,newline" ]]
|
||||
[[ end ]]
|
Reference in New Issue
Block a user