我尝试将with_items
与*
一起使用,但似乎不支持。
vars/main.yml
---
Z:
A1:
- "a"
- "b"
A2: "c"
A3:
- "d"
- "e"
tasks/main.yml
---
- name: Create folder
file:
path: "{{ item }}"
state: directory
mode: '0755'
owner: tomcat
group: tomcat
with_items:
- "/opt/Z/{{ Z.A1.* }}"
- "/opt/Z/{{ Z.A1.* }}/in"
- "/opt/Z/{{ Z.A1.* }}/in/output/"
- "/opt/Z/{{ Z.A1.* }}/in/output/fail"
- "/opt/Z/{{ Z.A1.* }}/in/output/success"
我想获得以下输出,我不确定如何将with_items
与array over array一起使用。
/opt/Z/a
/opt/Z/a/in
/opt/Z/a/in/output/
/opt/Z/a/in/output/fail
/opt/Z/a/in/output/success
/opt/Z/b
/opt/Z/b/in
/opt/Z/b/in/output/
/opt/Z/b/in/output/fail
/opt/Z/b/in/output/success