mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-03 23:26:58 +02:00
Update to 2022-09-13 17:00
This commit is contained in:
@@ -4,92 +4,40 @@ vault {
|
||||
unwrap_token = false
|
||||
}
|
||||
|
||||
# Sleep 10 sec before sending nomad service a reload to prevent it from crashing as
|
||||
# Sleep 25 sec before sending nomad service a reload to prevent it from crashing as
|
||||
# Nomad doesn't support getting a reload while it's still initializing
|
||||
{% if nomad_vault_secrets.pki.enabled %}
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/agent.crt.tpl"
|
||||
source = "{{ nomad_root_dir }}/consul-template/agent_bundle.pem.tpl"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_conf.tls.cert_file }}"
|
||||
perms = 0644
|
||||
exec {
|
||||
command = "sh -c 'sleep 10 && systemctl reload nomad || true'"
|
||||
}
|
||||
}
|
||||
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/agent.key.tpl"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_conf.tls.key_file }}"
|
||||
destination = "{{ nomad_root_dir }}/tls/agent_bundle.pem"
|
||||
perms = 0640
|
||||
exec {
|
||||
command = ["sh", "-c", "chgrp {{ nomad_user }} {{ nomad_conf.tls.key_file }} && sleep 10 && systemctl reload nomad || true"]
|
||||
}
|
||||
}
|
||||
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/ca.crt.tpl"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_conf.tls.ca_file }}"
|
||||
perms = 0644
|
||||
exec {
|
||||
command = "sh -c 'sleep 10 && systemctl reload nomad || true'"
|
||||
command = "sh -c 'sleep 25 && systemctl reload nomad || true'"
|
||||
}
|
||||
}
|
||||
|
||||
{% if nomad_conf.server.enabled %}
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/cli.crt.tpl"
|
||||
source = "{{ nomad_root_dir }}/consul-template/cli_bundle.pem.tpl"
|
||||
destination = "{{ nomad_root_dir }}/tls/cli_bundle.pem"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_root_dir }}/tls/cli.crt"
|
||||
}
|
||||
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/cli.key.tpl"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_root_dir }}/tls/cli.key"
|
||||
perms = 0640
|
||||
}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if nomad_vault_secrets.consul_pki.enabled and nomad_conf.consul.ssl %}
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/consul.crt.tpl"
|
||||
source = "{{ nomad_root_dir }}/consul-template/consul_bundle.pem.tpl"
|
||||
destination = "{{ nomad_root_dir }}/tlc/consul_bundle.pem"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_conf.consul.cert_file }}"
|
||||
exec {
|
||||
command = "sh -c 'sleep 10 && systemctl reload nomad || true'"
|
||||
}
|
||||
}
|
||||
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/consul.key.tpl"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_conf.consul.key_file }}"
|
||||
perms = 0640
|
||||
exec {
|
||||
command = "sh -c 'sleep 10 && systemctl reload nomad || true'"
|
||||
}
|
||||
}
|
||||
|
||||
template {
|
||||
source = "{{ nomad_root_dir }}/consul-template/consul_ca.crt.tpl"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
destination = "{{ nomad_conf.consul.ca_file }}"
|
||||
perms = 0644
|
||||
exec {
|
||||
command = "sh -c 'sleep 10 && systemctl reload nomad || true'"
|
||||
command = "sh -c 'sleep 25 && systemctl reload nomad || true'"
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user