首页 » 翻译 » Ansible » 正文

ansible 入门教程12 loops(循环)

标准的循环:


– name: add several users

   user :name={{ item }} state=presetn groups=wheel
   with_items:
          – testuser1
          – testuser2

变形版


– name: add several users
user: name={{ item.name }} state=present groups={{ item.groups }}
with_items:
– { name: ‘testuser1′, groups: ‘wheel’ }
– { name: ‘testuser2′, groups: ‘root’ }


欢迎转载,转载请注明出处:http://www.503error.com/

发表评论