2024-07-19 21:31:59 +00:00
|
|
|
---
|
2024-10-06 10:17:15 +00:00
|
|
|
# task/recursive_copy_extra_dirs file for consul
|
2024-07-19 21:31:59 +00:00
|
|
|
- name: "Consul | Ensure destination directory exists"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ dir_source_item.dest }}"
|
|
|
|
recurse: true
|
|
|
|
state: directory
|
|
|
|
mode: "0775"
|
|
|
|
|
|
|
|
- name: "Consul | Create extra directory sources"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ dir_source_item.dest }}/{{ item.path }}"
|
|
|
|
recurse: true
|
|
|
|
state: directory
|
|
|
|
mode: "0775"
|
|
|
|
with_community.general.filetree: "{{ dir_source_item.src }}/"
|
|
|
|
when: item.state == 'directory'
|
|
|
|
|
|
|
|
- name: "Consul | Template extra directory sources"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ dir_source_item.dest }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
|
|
|
owner: "{{ consul_user }}"
|
|
|
|
group: "{{ consul_group }}"
|
|
|
|
mode: "0700"
|
|
|
|
with_community.general.filetree: "{{ dir_source_item.src }}/"
|
|
|
|
when: item.state == 'file'
|