You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
825 B
35 lines
825 B
---
|
|
# 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
|
|
remote_user: root
|
|
|
|
tasks:
|
|
|
|
- name: install packages
|
|
yum: name={{ item }} state=installed
|
|
with_items:
|
|
- cobbler
|
|
- httpd
|
|
|
|
- name: configure users
|
|
user: name={{ item }} state=present groups=wheel
|
|
with_items:
|
|
- testuser1
|
|
- testuser2
|
|
|
|
- name: remove users
|
|
user: name={{ item }} state=absent
|
|
with_items:
|
|
- testuser1
|
|
- testuser2
|
|
|
|
- name: copy templates
|
|
template: src={{ item.src }} dest={{ item.dest }}
|
|
with_items:
|
|
- src: templates/testsource1
|
|
dest: /example/dest1/test.conf
|
|
- src: templates/testsource2
|
|
dest: /example/dest2/test.conf
|
|
|