Update to 2024-07-05 17:01

This commit is contained in:
Daniel Berteaud
2024-07-05 17:01:05 +02:00
parent b38fe8ecec
commit 17651158da
7 changed files with 26 additions and 9 deletions

View File

@@ -26,9 +26,14 @@ vault_agent_sinks: []
# List of templates
vault_agent_templates: []
# vault_agent_templates:
# # Use only one of source or contents
# # Use only one of source contents or data can be used
# - source: /srv/foo.tpl
# contents: "{{ with secret \"kv/bar\" }}{{.Data.data.baz}}{{ end }}"
# data: |
# [[- with pkiCert "pki/nomad/issue/jenkins" "common_name=jenkins.nomad" ]]
# [[ .Cert ]]
# [[ .Key ]]
# [[- end ]]
# destination: /src/foo
# left_delimiter = "[["
# right_delimiter = "]]"

View File

@@ -31,3 +31,9 @@
notify: restart vault-agent
tags: vault,consul,nomad
- name: Deploy templates
copy: content={{ item.data }} dest={{ vault_agent_root_dir }}/templates/ansible/{{ item.destination | regex_replace('/', '_') }}
when: item.data is defined
loop: "{{ vault_agent_templates }}"
notify: restart vault-agent
tags: vault,consul,nomad

View File

@@ -14,5 +14,7 @@
- dir: bin
- dir: templates/nomad
- dir: templates/consul
- dir: templates/ansible
- dir: templates/custom
tags: vault,consul,nomad

View File

@@ -51,6 +51,8 @@ template {
source = "{{ template.source }}"
{% elif template.contents is defined %}
contents = "{{ template.contents }}"
{% elif template.data is defined %}
source = "{{ vault_agent_root_dir }}/templates/ansible/{{ template.destination | regex_replace('/', '_') }}"
{% endif %}
destination = "{{ template.destination }}"
{% for prop in ['left_delimiter', 'right_delimiter', 'perms'] %}