-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathnode-template.yaml
36 lines (31 loc) · 1.21 KB
/
node-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Required Parameter: node
- name: orchestrate {{ node.name }} - clean
ansible.builtin.file:
path: "{{ node.name }}"
state: absent
- name: orchestrate {{ node.name }} - hadoop-common - mkdir
ansible.builtin.file:
path: "{{ node.name }}/{{ item.path }}"
state: directory
with_community.general.filetree: "templates/hadoop-common"
when: item.state == "directory"
- name: orchestrate {{ node.name }} - hadoop-common - template
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ node.name }}/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "a+x"
with_community.general.filetree: "templates/hadoop-common"
when: item.state == "file"
- name: orchestrate {{ node.name }} - {{ node.group }} - mkdir
ansible.builtin.file:
path: "{{ node.name }}/{{ item.path }}"
state: directory
with_community.general.filetree: "templates/{{ node.group }}"
when: item.state == "directory"
- name: orchestrate {{ node.name }} - {{ node.group }} - template
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ node.name }}/{{ item.path | regex_replace('\\.j2$', '') }}"
mode: "a+x"
with_community.general.filetree: "templates/{{ node.group }}"
when: item.state == "file"