|
|
|
@ -11,14 +11,18 @@ Example::
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
- yum: name={{ item }} state=installed
|
|
|
|
|
- yum:
|
|
|
|
|
name: "{{ item }}"
|
|
|
|
|
state: installed
|
|
|
|
|
loop:
|
|
|
|
|
- httpd
|
|
|
|
|
- memcached
|
|
|
|
|
tags:
|
|
|
|
|
- packages
|
|
|
|
|
|
|
|
|
|
- template: src=templates/src.j2 dest=/etc/foo.conf
|
|
|
|
|
- template:
|
|
|
|
|
src: templates/src.j2
|
|
|
|
|
dest: /etc/foo.conf
|
|
|
|
|
tags:
|
|
|
|
|
- configuration
|
|
|
|
|
|
|
|
|
@ -44,17 +48,24 @@ Example::
|
|
|
|
|
# file: roles/common/tasks/main.yml
|
|
|
|
|
|
|
|
|
|
- name: be sure ntp is installed
|
|
|
|
|
yum: name=ntp state=installed
|
|
|
|
|
yum:
|
|
|
|
|
name: ntp
|
|
|
|
|
state: installed
|
|
|
|
|
tags: ntp
|
|
|
|
|
|
|
|
|
|
- name: be sure ntp is configured
|
|
|
|
|
template: src=ntp.conf.j2 dest=/etc/ntp.conf
|
|
|
|
|
template:
|
|
|
|
|
src: ntp.conf.j2
|
|
|
|
|
dest: /etc/ntp.conf
|
|
|
|
|
notify:
|
|
|
|
|
- restart ntpd
|
|
|
|
|
tags: ntp
|
|
|
|
|
|
|
|
|
|
- name: be sure ntpd is running and enabled
|
|
|
|
|
service: name=ntpd state=started enabled=yes
|
|
|
|
|
service:
|
|
|
|
|
name: ntpd
|
|
|
|
|
state: started
|
|
|
|
|
enabled: yes
|
|
|
|
|
tags: ntp
|
|
|
|
|
|
|
|
|
|
.. _tag_inheritance:
|
|
|
|
@ -110,11 +121,13 @@ Example::
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
- debug: msg="Always runs"
|
|
|
|
|
- debug:
|
|
|
|
|
msg: "Always runs"
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
|
|
|
|
- debug: msg="runs when you use tag1"
|
|
|
|
|
- debug:
|
|
|
|
|
msg: "runs when you use tag1"
|
|
|
|
|
tags:
|
|
|
|
|
- tag1
|
|
|
|
|
|
|
|
|
|