Merge pull request #249 from aboe76/master

use watch module: apache-[restart|reload] consequently
This commit is contained in:
Javier Bértoli 2018-11-09 15:25:11 -03:00 committed by GitHub
commit a881f63780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 340 additions and 7 deletions

View File

@ -17,6 +17,10 @@ apache_cert_config_{{ site }}_key_file:
- group: root - group: root
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{% if confcert.SSLCertificateFile is defined and confcert.SSLCertificateFile_content is defined %} {% if confcert.SSLCertificateFile is defined and confcert.SSLCertificateFile_content is defined %}
@ -31,6 +35,10 @@ apache_cert_config_{{ site }}_cert_file:
- group: root - group: root
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{% if confcert.SSLCertificateChainFile is defined and confcert.SSLCertificateChainFile_content is defined %} {% if confcert.SSLCertificateChainFile is defined and confcert.SSLCertificateChainFile_content is defined %}
@ -45,6 +53,10 @@ apache_cert_config_{{ site }}_bundle_file:
- group: root - group: root
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{%- endfor %} {%- endfor %}

View File

@ -9,6 +9,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{{ apache.configfile }}: {{ apache.configfile }}:
@ -19,6 +23,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
- context: - context:
apache: {{ apache }} apache: {{ apache }}
@ -29,6 +37,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{% if grains['os_family']=="Debian" %} {% if grains['os_family']=="Debian" %}
@ -40,6 +52,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{{ apache.portsfile }}: {{ apache.portsfile }}:
@ -50,6 +66,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
- context: - context:
apache: {{ apache }} apache: {{ apache }}
@ -62,6 +82,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{% endif %} {% endif %}
@ -74,6 +98,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
- context: - context:
apache: {{ apache }} apache: {{ apache }}
@ -88,6 +116,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{{ apache.portsfile }}: {{ apache.portsfile }}:
@ -98,6 +130,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
- context: - context:
apache: {{ apache }} apache: {{ apache }}

View File

@ -24,6 +24,10 @@ a2dissite 000-default{{ apache.confext }}:
- onlyif: test -f /etc/apache2/sites-enabled/000-default{{ apache.confext }} - onlyif: test -f /etc/apache2/sites-enabled/000-default{{ apache.confext }}
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
- require: - require:
- pkg: apache - pkg: apache

View File

@ -3,6 +3,8 @@
apache: apache:
manage_service_states: True manage_service_states: True
service_state: running
service_enable: True
mod_security: mod_security:
crs_install: False crs_install: False

View File

@ -13,6 +13,10 @@ a2enflag {{ flag }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% for module in salt['pillar.get']('apache:flags:disabled', []) %} {% for module in salt['pillar.get']('apache:flags:disabled', []) %}
@ -23,6 +27,10 @@ a2disflag -f {{ flag }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -12,26 +12,35 @@ apache:
- system: True - system: True
{# By default run apache service states (unless pillar is false) #} {# By default run apache service states (unless pillar is false) #}
{% if salt['pillar.get']('apache:manage_service_states', True) %} {% if salt['pillar.get']('apache:manage_service_states', True) %}
service.running: service.{{apache.service_state}}:
- name: {{ apache.service }} - name: {{ apache.service }}
{% if apache.service_state in [ 'running', 'dead' ] %}
- enable: True - enable: True
- require: {% endif %}
- module: apache-restart
- module: apache-reload
# The following states are inert by default and can be used by other states to # The following states are inert by default and can be used by other states to
# trigger a restart or reload as needed. # trigger a restart or reload as needed.
apache-reload: apache-reload:
module.wait: module.wait:
{% if apache.service_state in ['running'] %}
- name: service.reload - name: service.reload
- m_name: {{ apache.service }} - m_name: {{ apache.service }}
- require: {% else %}
- module: apache-restart - name: cmd.run
- cmd: {{apache.custom_reload_command|default('apachectl graceful')}}
- python_shell: True
{% endif %}
apache-restart: apache-restart:
module.wait: module.wait:
{% if apache.service_state in ['running'] %}
- name: service.restart - name: service.restart
- m_name: {{ apache.service }} - m_name: {{ apache.service }}
{% else %}
- name: cmd.run
- cmd: {{apache.custom_reload_command|default('apachectl graceful')}}
- python_shell: True
{% endif %}
{% else %} {% else %}

View File

@ -12,6 +12,10 @@
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{%- endmacro %} {%- endmacro %}
include: include:

View File

@ -11,5 +11,9 @@ a2enmod actions:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -14,5 +14,9 @@ include:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -16,6 +16,10 @@ a2enmod dav_svn:
- pkg: libapache2-mod-svn - pkg: libapache2-mod-svn
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
a2enmod authz_svn: a2enmod authz_svn:
cmd.run: cmd.run:
@ -26,5 +30,9 @@ a2enmod authz_svn:
- pkg: libapache2-mod-svn - pkg: libapache2-mod-svn
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -12,6 +12,12 @@ mod-fastcgi:
- require: - require:
- pkgrepo: repo-fastcgi - pkgrepo: repo-fastcgi
- pkg: apache - pkg: apache
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
repo-fastcgi: repo-fastcgi:
pkgrepo.managed: pkgrepo.managed:
@ -28,6 +34,10 @@ a2enmod fastcgi:
- pkg: mod-fastcgi - pkg: mod-fastcgi
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -20,5 +20,9 @@ a2enmod fcgid for apache.mod_fcgid:
- pkg: mod-fcgid - pkg: mod-fcgid
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -12,9 +12,13 @@ mod-geoip:
- {{ apache.mod_geoip_database }} - {{ apache.mod_geoip_database }}
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if grains['os_family']=="RedHat" %} {% if grains['os_family']=="RedHat" %}
geoip conf: geoip conf:

View File

@ -11,5 +11,9 @@ a2enmod headers:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -13,6 +13,10 @@ a2enmod {{ mpm_module }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
file.managed: file.managed:
- name: /etc/apache2/mods-available/{{ mpm_module }}.conf - name: /etc/apache2/mods-available/{{ mpm_module }}.conf
- template: jinja - template: jinja
@ -22,6 +26,10 @@ a2enmod {{ mpm_module }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
# Deactivate the other mpm modules as a previous step # Deactivate the other mpm modules as a previous step
{% for mod in ['mpm_prefork', 'mpm_worker', 'mpm_event'] if not mod == mpm_module %} {% for mod in ['mpm_prefork', 'mpm_worker', 'mpm_event'] if not mod == mpm_module %}
@ -34,6 +42,10 @@ a2dismod {{ mod }}:
- cmd: a2enmod {{ mpm_module }} - cmd: a2enmod {{ mpm_module }}
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% endif %} {% endif %}
@ -53,5 +65,9 @@ include:
- pkg: httpd - pkg: httpd
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -17,6 +17,10 @@ a2enmod pagespeed:
- require: - require:
- pkg: libapache2-mod-pagespeed - pkg: libapache2-mod-pagespeed
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{% for dir in ['/var/cache/mod_pagespeed', '/var/log/pagespeed'] %} {% for dir in ['/var/cache/mod_pagespeed', '/var/log/pagespeed'] %}

View File

@ -9,6 +9,12 @@ mod-perl2:
- order: 180 - order: 180
- require: - require:
- pkg: apache - pkg: apache
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if grains['os_family']=="Debian" %} {% if grains['os_family']=="Debian" %}
a2enmod perl2: a2enmod perl2:
@ -19,6 +25,10 @@ a2enmod perl2:
- pkg: mod-perl2 - pkg: mod-perl2
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% elif grains['os_family']=="FreeBSD" %} {% elif grains['os_family']=="FreeBSD" %}
@ -31,5 +41,9 @@ a2enmod perl2:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -19,6 +19,10 @@ a2enmod php5:
- pkg: mod-php5 - pkg: mod-php5
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if 'apache' in pillar and 'php-ini' in pillar['apache'] %} {% if 'apache' in pillar and 'php-ini' in pillar['apache'] %}
/etc/php5/apache2/php.ini: /etc/php5/apache2/php.ini:
@ -27,6 +31,10 @@ a2enmod php5:
- order: 225 - order: 225
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
- require: - require:
- pkg: apache - pkg: apache
- pkg: mod-php5 - pkg: mod-php5
@ -43,6 +51,10 @@ a2enmod php5:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -13,6 +13,10 @@ a2enmod mod_proxy:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% elif grains['os_family']=="FreeBSD" %} {% elif grains['os_family']=="FreeBSD" %}
{{ apache.modulesdir }}/040_mod_proxy.conf: {{ apache.modulesdir }}/040_mod_proxy.conf:
@ -24,5 +28,9 @@ a2enmod mod_proxy:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -13,5 +13,9 @@ a2enmod proxy_fcgi:
- cmd: a2enmod proxy - cmd: a2enmod proxy
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -15,6 +15,10 @@ a2enmod proxy_http:
- cmd: a2enmod proxy - cmd: a2enmod proxy
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% elif grains['os_family']=="FreeBSD" %} {% elif grains['os_family']=="FreeBSD" %}
{{ apache.modulesdir }}/040_mod_proxy_http.conf: {{ apache.modulesdir }}/040_mod_proxy_http.conf:
@ -26,5 +30,9 @@ a2enmod proxy_http:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -11,6 +11,10 @@ a2enmod remoteip:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
a2enconf remoteip: a2enconf remoteip:
cmd.run: cmd.run:
@ -20,6 +24,10 @@ a2enconf remoteip:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
/etc/apache2/conf-available/remoteip.conf: /etc/apache2/conf-available/remoteip.conf:
file.managed: file.managed:
@ -29,6 +37,10 @@ a2enconf remoteip:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{% endif %} {% endif %}
@ -46,6 +58,10 @@ include:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{% endif %} {% endif %}

View File

@ -12,6 +12,10 @@ a2enmod rewrite:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% elif grains['os_family']=="FreeBSD" %} {% elif grains['os_family']=="FreeBSD" %}
@ -24,5 +28,9 @@ a2enmod rewrite:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -9,6 +9,12 @@ mod-security:
- order: 180 - order: 180
- require: - require:
- pkg: apache - pkg: apache
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if apache.mod_security.crs_install %} {% if apache.mod_security.crs_install %}
mod-security-crs: mod-security-crs:
@ -17,6 +23,12 @@ mod-security-crs:
- order: 180 - order: 180
- require: - require:
- pkg: mod-security - pkg: mod-security
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{% if apache.mod_security.manage_config %} {% if apache.mod_security.manage_config %}
@ -32,6 +44,10 @@ mod-security-main-config:
- pkg: mod-security - pkg: mod-security
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{% if grains['os_family']=="Debian" %} {% if grains['os_family']=="Debian" %}
@ -43,4 +59,8 @@ a2enmod security2:
- pkg: mod-security - pkg: mod-security
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -14,6 +14,10 @@ include:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
- context: - context:
module_name: socache_shmcb module_name: socache_shmcb

View File

@ -14,6 +14,10 @@ a2enmod mod_ssl:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
/etc/apache2/mods-available/ssl.conf: /etc/apache2/mods-available/ssl.conf:
file.managed: file.managed:
@ -32,12 +36,20 @@ mod_ssl:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{{ apache.confdir }}/ssl.conf: {{ apache.confdir }}/ssl.conf:
file.absent: file.absent:
- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache - service: apache
{% elif grains['os_family']=="FreeBSD" %} {% elif grains['os_family']=="FreeBSD" %}
@ -55,6 +67,10 @@ include:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
@ -71,6 +87,10 @@ include:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if grains['os_family']=="Debian" %} {% if grains['os_family']=="Debian" %}
a2endisconf tls-defaults: a2endisconf tls-defaults:
@ -88,4 +108,8 @@ a2endisconf tls-defaults:
- file: {{ apache.confdir }}/tls-defaults.conf - file: {{ apache.confdir }}/tls-defaults.conf
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -14,5 +14,9 @@ include:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -11,5 +11,9 @@ a2enmod vhost_alias:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -8,6 +8,12 @@ mod_wsgi:
- name: {{ apache.mod_wsgi }} - name: {{ apache.mod_wsgi }}
- require: - require:
- pkg: apache - pkg: apache
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if 'conf_mod_wsgi' in apache %} {% if 'conf_mod_wsgi' in apache %}
{{ apache.conf_mod_wsgi }}: {{ apache.conf_mod_wsgi }}:
@ -16,4 +22,10 @@ mod_wsgi:
- onlyif: test -f {{ apache.conf_mod_wsgi }} - onlyif: test -f {{ apache.conf_mod_wsgi }}
- require: - require:
- pkg: mod_wsgi - pkg: mod_wsgi
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -9,6 +9,12 @@ mod-xsendfile:
- order: 180 - order: 180
- require: - require:
- pkg: apache - pkg: apache
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if grains['os_family']=="Debian" %} {% if grains['os_family']=="Debian" %}
a2enmod xsendfile: a2enmod xsendfile:
@ -19,6 +25,10 @@ a2enmod xsendfile:
- pkg: mod-xsendfile - pkg: mod-xsendfile
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -12,6 +12,10 @@ a2enmod {{ module }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% for module in salt['pillar.get']('apache:modules:disabled', []) %} {% for module in salt['pillar.get']('apache:modules:disabled', []) %}
@ -23,6 +27,10 @@ a2dismod -f {{ module }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% elif grains['os_family']=="RedHat" %} {% elif grains['os_family']=="RedHat" %}
@ -39,6 +47,10 @@ find /etc/httpd/ -name '*.conf' -type f -exec sed -i -e 's/\(^#\)\(\s*LoadModule
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% for module in salt['pillar.get']('apache:modules:disabled', []) %} {% for module in salt['pillar.get']('apache:modules:disabled', []) %}
@ -50,6 +62,10 @@ find /etc/httpd/ -name '*.conf' -type f -exec sed -i -e 's/\(^\s*LoadModule.{{ m
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% elif salt['grains.get']('os_family') == 'Suse' or salt['grains.get']('os') == 'SUSE' %} {% elif salt['grains.get']('os_family') == 'Suse' or salt['grains.get']('os') == 'SUSE' %}
@ -66,6 +82,10 @@ a2enmod {{ module }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% for module in salt['pillar.get']('apache:modules:disabled', []) %} {% for module in salt['pillar.get']('apache:modules:disabled', []) %}
@ -77,6 +97,10 @@ a2dismod -f {{ module }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-restart - module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -12,5 +12,9 @@ a2dissite 000-default.conf:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -13,5 +13,9 @@ apache_own-default-vhost:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}

View File

@ -49,6 +49,10 @@
- watch_in: - watch_in:
- cmd: {{ a2modid }} - cmd: {{ a2modid }}
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module; apache-reload
- service: apache
{% endif %} {% endif %}
########################################## ##########################################

View File

@ -29,6 +29,10 @@ a2dissite {{ filename }}:
- onlyif: "test -L {{ dirpath}}/{{ filename }} || test -f {{ dirpath}}/{{ filename }}" - onlyif: "test -L {{ dirpath}}/{{ filename }} || test -f {{ dirpath}}/{{ filename }}"
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -19,6 +19,10 @@ apache_vhosts_{{ id }}:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% if site.get('DocumentRoot') != False %} {% if site.get('DocumentRoot') != False %}
{{ id }}-documentroot: {{ id }}-documentroot:
@ -39,6 +43,10 @@ a2ensite {{ id }}{{ apache.confext }}:
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }} - file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% else %} {% else %}
a2dissite {{ id }}{{ apache.confext }}: a2dissite {{ id }}{{ apache.confext }}:
cmd.run: cmd.run:
@ -47,6 +55,10 @@ a2dissite {{ id }}{{ apache.confext }}:
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }} - file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
- watch_in: - watch_in:
- module: apache-reload - module: apache-reload
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %} {% endif %}
{% endif %} {% endif %}