2
0

rajout handler

This commit is contained in:
2020-05-05 22:52:52 +02:00
parent a7798332ab
commit 8e795638ab

View File

@@ -1,13 +1,17 @@
--- ---
- name: install apache via ansible playbook - name: install apache via ansible playbook
hosts: test hosts: all
become: true handlers:
user: ansible - name: restart apache
service:
name: httpd
state: restarted
tasks: tasks:
- name: install apache - name: install apache
yum: yum:
name: httpd name: httpd
state: latest state: present
- name: conf httpd - name: conf httpd
template: template:
@@ -16,15 +20,15 @@
mode: 0640 mode: 0640
owner: root owner: root
group: apache group: apache
notify: restart apache
- name: activate apache - name: activate apache
service: service:
name: httpd name: httpd
enabled: yes enabled: yes
state: restarted state: started
- name: open firewall port - name: open firewall port
tags: dev
firewalld: firewalld:
service: http service: http
permanent: yes permanent: yes