r/apache-base: Factor out handlers for reuse
Roles that need to reload or restart Apache after writing configuration files do not necessarily need to depend on the _apache_ role, but may assume Apache is deployed in some other way. To support this, I have factored out the handlers from the _apache_ role into an _apache-base_ role, which such roles can list as a dependency.
This commit is contained in:
9
roles/apache-base/handlers/main.yml
Normal file
9
roles/apache-base/handlers/main.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
- name: restart httpd
|
||||||
|
service:
|
||||||
|
name: httpd
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: reload httpd
|
||||||
|
service:
|
||||||
|
name: httpd
|
||||||
|
state: reloaded
|
||||||
@@ -1,11 +1,3 @@
|
|||||||
- name: restart httpd
|
|
||||||
service:
|
|
||||||
name=httpd
|
|
||||||
state=restarted
|
|
||||||
- name: reload httpd
|
|
||||||
service:
|
|
||||||
name=httpd
|
|
||||||
state=reloaded
|
|
||||||
- name: save firewalld configuration
|
- name: save firewalld configuration
|
||||||
command:
|
command:
|
||||||
firewall-cmd --runtime-to-permanent
|
firewall-cmd --runtime-to-permanent
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ dependencies:
|
|||||||
- role: logrotate
|
- role: logrotate
|
||||||
tags:
|
tags:
|
||||||
- logrotate
|
- logrotate
|
||||||
|
- role: apache-base
|
||||||
|
|||||||
Reference in New Issue
Block a user