convert task to handler
This commit is contained in:
@@ -1,24 +1,18 @@
|
|||||||
---
|
---
|
||||||
- name: install apache via ansible playbook
|
- name: install apache via ansible playbook
|
||||||
hosts: test
|
hosts: test
|
||||||
user: ansible
|
|
||||||
become: true
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: reload httpd
|
- name: reload httpd
|
||||||
service:
|
service:
|
||||||
name: httpd
|
name: httpd
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: reload firewalld
|
|
||||||
service:
|
|
||||||
name: firewalld
|
|
||||||
state: reloaded
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: install apache
|
- name: install apache
|
||||||
yum:
|
yum:
|
||||||
name: httpd
|
name: httpd
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: conf httpd
|
- name: conf httpd
|
||||||
notify: reload httpd
|
notify: reload httpd
|
||||||
template:
|
template:
|
||||||
@@ -40,7 +34,6 @@
|
|||||||
immediate: yes
|
immediate: yes
|
||||||
state: enabled
|
state: enabled
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
notify: reload firewalld
|
|
||||||
|
|
||||||
- name: create documentroot
|
- name: create documentroot
|
||||||
file:
|
file:
|
||||||
@@ -51,4 +44,4 @@
|
|||||||
copy:
|
copy:
|
||||||
src: index.html
|
src: index.html
|
||||||
dest: /var/www/html/orsys.fr/index.html
|
dest: /var/www/html/orsys.fr/index.html
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|||||||
Reference in New Issue
Block a user