mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-03 23:26:58 +02:00
Update to 2024-10-24 12:00
This commit is contained in:
@@ -12,6 +12,16 @@ template {
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if nomad_conf.server.enabled %}
|
||||
template {
|
||||
source = "{{ vault_agent_root_dir }}/templates/nomad/vault.env.tpl"
|
||||
destination = "/run/nomad/vault_config.env"
|
||||
left_delimiter = "[["
|
||||
right_delimiter = "]]"
|
||||
perms = 0640
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if vault_agent_nomad.nomad_pki.enabled %}
|
||||
template {
|
||||
source = "{{ vault_agent_root_dir }}/templates/nomad/agent_bundle.pem.tpl"
|
||||
|
@@ -13,9 +13,9 @@ elif [ "$(echo ${VAULT_STATUS} | jq .initialized)" != "true" ]; then
|
||||
echo "Vault is not initialized yet, exiting"
|
||||
else
|
||||
echo Updating Vault certificate to access Nomad API
|
||||
if [ -z "${VAULT_TOKEN}" -a -e /run/nomad/vault.env ]; then
|
||||
if [ -z "${VAULT_TOKEN}" -a -e /run/nomad/vault_config.env ]; then
|
||||
echo "Using VAULT_TOKEN from Nomad agent"
|
||||
export $(cat /run/nomad/vault.env)
|
||||
export $(cat /run/nomad/vault_config.env)
|
||||
fi
|
||||
vault write {{ vault_agent_nomad.nomad_pki.cli.secret_path | default('nomad') }}/config/access \
|
||||
ca_cert="$(cat {{ nomad_root_dir }}/tls/ca.crt)" \
|
||||
|
Reference in New Issue
Block a user