with 项目 - 字典
你可以使用字典来进行稍微复杂的循环。
- name: manage packages
package: name={{ item.name }} state={{ item.state }}
with_items:
- { name: tree, state: present }
- { name: nmap, state: present }
- { name: apache2, state: absent }
你可以使用字典来进行稍微复杂的循环。
- name: manage packages
package: name={{ item.name }} state={{ item.state }}
with_items:
- { name: tree, state: present }
- { name: nmap, state: present }
- { name: apache2, state: absent }