2
0

convert task to handler

This commit is contained in:
2020-05-05 22:53:39 +02:00
parent 8e795638ab
commit 60d2b5342a

View File

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