循环控制语句 之 with_together
功能类似于:
列表元素数量上要一一对应for i in zip([1,2,3],['a','b','c']): print(i)
- hosts: all
tasks:
- name: debug
debug:
msg: "{{ item }}"
with_together:
- ["a","b","c"]
- [1,2,3]
功能类似于:
列表元素数量上要一一对应for i in zip([1,2,3],['a','b','c']): print(i)
- hosts: all
tasks:
- name: debug
debug:
msg: "{{ item }}"
with_together:
- ["a","b","c"]
- [1,2,3]