hcp-ansible/roles/vault/tasks/recursive_copy_extra_dirs.yml
Bertrand Lanson 66a4f6b5da
All checks were successful
development / Check commit compliance (push) Successful in 25s
pull-requests-open / Check commit compliance (pull_request) Successful in 32s
feat(vault): enable rolling restart with no full seal
2024-09-02 22:24:58 +02:00

27 lines
862 B
YAML

---
# task/recursive_copy_extra_dirs file for hashicorp_vault
- name: "Vault | Ensure destination directory exists"
ansible.builtin.file:
path: "{{ dir_source_item.dest }}"
recurse: true
state: directory
mode: "0755"
- name: "Vault | Create extra directory sources"
ansible.builtin.file:
path: "{{ dir_source_item.dest }}/{{ item.path }}"
state: directory
mode: "0755"
with_community.general.filetree: "{{ dir_source_item.src }}/"
when: item.state == 'directory'
- name: "Vault | Template extra directory sources"
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ dir_source_item.dest }}/{{ item.path | regex_replace('\\.j2$', '') }}"
owner: "{{ vault_user }}"
group: "{{ vault_group }}"
mode: "0700"
with_community.general.filetree: "{{ dir_source_item.src }}/"
when: item.state == 'file'