2012-04-14 15:55:24 +02:00
|
|
|
---
|
|
|
|
# this is an example of how to run repeated task elements over lists
|
|
|
|
# of items, for example, installing multiple packages or configuring
|
|
|
|
# multiple users
|
|
|
|
|
|
|
|
- hosts: all
|
|
|
|
user: root
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
2013-05-05 19:39:03 +02:00
|
|
|
- name: install packages
|
|
|
|
action: yum name={{ item }} state=installed
|
2012-04-14 15:55:24 +02:00
|
|
|
with_items:
|
|
|
|
- cobbler
|
|
|
|
- httpd
|
|
|
|
|
2013-05-05 19:39:03 +02:00
|
|
|
- name: configure users
|
|
|
|
action: user name={{ item }} state=present groups=wheel
|
2012-04-14 15:55:24 +02:00
|
|
|
with_items:
|
|
|
|
- testuser1
|
|
|
|
- testuser2
|
|
|
|
|
2013-05-05 19:39:03 +02:00
|
|
|
- name: remove users
|
|
|
|
action: user name={{ item }} state=absent
|
2012-04-14 15:55:24 +02:00
|
|
|
with_items:
|
|
|
|
- testuser1
|
|
|
|
- testuser2
|
|
|
|
|
|
|
|
|
|
|
|
|