mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Ability to import task lists and handler lists from a top level playbook file. It is possible
to use multiple import statements to implement 'class' like behavior, and also to share a common list of handlers between multiple patterns.
This commit is contained in:
5
examples/base.yml
Normal file
5
examples/base.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: no selinux
|
||||
action: command /usr/sbin/setenforce 0
|
||||
- name: no iptables
|
||||
action: service name=iptables state=stopped
|
||||
5
examples/handlers.yml
Normal file
5
examples/handlers.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: restart apache
|
||||
action: service name=httpd state=restarted
|
||||
- name: restart memcached
|
||||
action: service name=memcached state=restarted
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
- hosts: '*'
|
||||
tasks:
|
||||
- include: base.yml
|
||||
- name: configure template & module variables for future template calls
|
||||
action: setup http_port=80 max_clients=200
|
||||
- name: write the apache config file
|
||||
@@ -10,5 +11,4 @@
|
||||
- name: ensure apache is running
|
||||
action: service name=httpd state=started
|
||||
handlers:
|
||||
- name: restart apache
|
||||
- action: service name=httpd state=restarted
|
||||
- include: handlers.yml
|
||||
|
||||
Reference in New Issue
Block a user