Update to 2023-07-09 17:00

This commit is contained in:
Daniel Berteaud 2023-07-09 17:00:09 +02:00
parent d87c1bdc89
commit 3e396d6020
3 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@
[[ .Cert ]] [[ .Cert ]]
[[ .Key ]] [[ .Key ]]
[[ .Cert | writeToFile "{{ consul_conf.tls.defaults.cert_file }}" "root" "{{ consul_user }}" "0644" ]] [[ .Cert | writeToFile "{{ consul_conf.tls.defaults.cert_file }}" "root" "{{ consul_user }}" "0644" ]]
[[ .CA | writeToFile "{{ consul_conf.tls.defaults.cert_file }}" "" "" "0644" "append,newline" ]]
[[ .Key | writeToFile "{{ consul_conf.tls.defaults.key_file }}" "root" "{{ consul_user }}" "0640" ]] [[ .Key | writeToFile "{{ consul_conf.tls.defaults.key_file }}" "root" "{{ consul_user }}" "0640" ]]
[[ end ]] [[ end ]]
{% else %} {% else %}

View File

@ -2,8 +2,9 @@
[[ .CA ]] [[ .CA ]]
[[ .Cert ]] [[ .Cert ]]
[[ .Key ]] [[ .Key ]]
[[ .Cert | writeToFile "{{ nomad_conf.tls.cert_file }}" "{{ nomad_user }}" "{{ nomad_user }}" "0644" ]] [[ .Cert | writeToFile "{{ nomad_conf.tls.cert_file }}" "root" "{{ nomad_user }}" "0644" ]]
[[ .Key | writeToFile "{{ nomad_conf.tls.key_file }}" "{{ nomad_user }}" "{{ nomad_user }}" "0640" ]] [[ .CA | writeToFile "{{ nomad_conf.tls.cert_file }}" "" "" "0644" "append,newline" ]]
[[ .Key | writeToFile "{{ nomad_conf.tls.key_file }}" "root" "{{ nomad_user }}" "0640" ]]
[[ end ]] [[ end ]]
[[ with secret "{{ vault_agent_nomad.nomad_pki.path }}/cert/ca_chain" ]] [[ with secret "{{ vault_agent_nomad.nomad_pki.path }}/cert/ca_chain" ]]
[[ .Data.certificate | writeToFile "{{ nomad_conf.tls.ca_file }}" "{{ nomad_user }}" "{{ nomad_user }}" "0644" ]] [[ .Data.certificate | writeToFile "{{ nomad_conf.tls.ca_file }}" "{{ nomad_user }}" "{{ nomad_user }}" "0644" ]]

View File

@ -13,7 +13,7 @@ elif [ "$(echo ${VAULT_STATUS} | jq .initialized)" != "true" ]; then
echo "Vault is not initialized yet, exiting" echo "Vault is not initialized yet, exiting"
else else
echo Updating Vault certificate to access Nomad API echo Updating Vault certificate to access Nomad API
vault write {{ vault_agent_nomad.nomad_pki.cli.secret_path }}/config/access \ vault write {{ vault_agent_nomad.nomad_pki.cli.secret_path | default('nomad') }}/config/access \
ca_cert="$(cat {{ nomad_root_dir }}/tls/ca.crt)" \ ca_cert="$(cat {{ nomad_root_dir }}/tls/ca.crt)" \
client_cert="$(cat {{ nomad_root_dir }}/tls/cli.crt)" \ client_cert="$(cat {{ nomad_root_dir }}/tls/cli.crt)" \
client_key="$(cat {{ nomad_root_dir }}/tls/cli.key)" client_key="$(cat {{ nomad_root_dir }}/tls/cli.key)"