-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtree.yaml
35 lines (31 loc) · 990 Bytes
/
tree.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
---
# This playbook example contains simple use cases that illustrate the basics functionality of join filter.
- name: Tree
gather_facts: false
hosts: localhost
vars:
path: /tmp
tree:
- path: foo
- path: foo/bar
content: |
Bar
- path: foo/baz
template: template.j2
- path: qux
state: absent
tasks:
- name: Tree with simple path
manala.path.path:
path: "{{ item.path }}"
state: "{{ item.state | default(omit) }}"
content: "{{ item.content | default(omit) }}"
template: "{{ item.template | default(omit) }}"
loop: "{{ tree | manala.path.join(path) }}"
- name: Tree with multiple paths
manala.path.path:
path: "{{ item.path }}"
state: "{{ item.state | default(omit) }}"
content: "{{ item.content | default(omit) }}"
template: "{{ item.template | default(omit) }}"
loop: "{{ tree | manala.path.join(path, 'service') }}"