标签:with span task creat use 字典 data groups 循环
Ansible 2.5开始就可以使用loop来创建循环。
tasks:
- name: create user
user:
name: {{ item }}
loop:
- user01
- user02
- user03
tasks:
- name: create user and group
user:
name: {{ item.name }}
group: {{ item.groups }}
loop:
- name: ‘testuser1‘
groups: ‘wheel‘
- name: ‘testuser2‘
groups: ‘root‘
未完待续...
标签:with span task creat use 字典 data groups 循环
原文地址:https://www.cnblogs.com/vincenshen/p/12587749.html