Browse Source

use watch module: apache-[restart|reload] consequently

tags/v0.37.4
Niels Abspoel 6 years ago
parent
commit
9490c868e0
36 changed files with 340 additions and 7 deletions
  1. +12
    -0
      apache/certificates.sls
  2. +36
    -0
      apache/config.sls
  3. +4
    -0
      apache/debian_full.sls
  4. +2
    -0
      apache/defaults.yaml
  5. +8
    -0
      apache/flags.sls
  6. +15
    -6
      apache/init.sls
  7. +4
    -0
      apache/manage_security.sls
  8. +4
    -0
      apache/mod_actions.sls
  9. +4
    -0
      apache/mod_cgi.sls
  10. +8
    -0
      apache/mod_dav_svn.sls
  11. +10
    -0
      apache/mod_fastcgi.sls
  12. +4
    -0
      apache/mod_fcgid.sls
  13. +5
    -1
      apache/mod_geoip.sls
  14. +4
    -0
      apache/mod_headers.sls
  15. +16
    -0
      apache/mod_mpm.sls
  16. +4
    -0
      apache/mod_pagespeed.sls
  17. +14
    -0
      apache/mod_perl2.sls
  18. +12
    -0
      apache/mod_php5.sls
  19. +8
    -0
      apache/mod_proxy.sls
  20. +4
    -0
      apache/mod_proxy_fcgi.sls
  21. +8
    -0
      apache/mod_proxy_http.sls
  22. +16
    -0
      apache/mod_remoteip.sls
  23. +8
    -0
      apache/mod_rewrite.sls
  24. +20
    -0
      apache/mod_security/init.sls
  25. +4
    -0
      apache/mod_socache_shmcb.sls
  26. +24
    -0
      apache/mod_ssl.sls
  27. +4
    -0
      apache/mod_suexec.sls
  28. +4
    -0
      apache/mod_vhost_alias.sls
  29. +12
    -0
      apache/mod_wsgi.sls
  30. +10
    -0
      apache/mod_xsendfile.sls
  31. +24
    -0
      apache/modules.sls
  32. +4
    -0
      apache/no_default_vhost.sls
  33. +4
    -0
      apache/own_default_vhost.sls
  34. +4
    -0
      apache/register_site.sls
  35. +4
    -0
      apache/vhosts/cleanup.sls
  36. +12
    -0
      apache/vhosts/standard.sls

+ 12
- 0
apache/certificates.sls View 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 %}
- 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 %}
- 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 %}

+ 36
- 0
apache/config.sls View File

- 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 }}:
- 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 }}
- 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" %}
- 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 }}:
- 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 }}
- 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 %}


- 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 }}
- 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 }}:
- 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 }}

+ 4
- 0
apache/debian_full.sls View File

- 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



+ 2
- 0
apache/defaults.yaml View File



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

+ 8
- 0
apache/flags.sls View File

- 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', []) %}
- 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 %}

+ 15
- 6
apache/init.sls View File

- 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:
- module: apache-restart
- module: apache-reload
{% endif %}


# 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:
- module: apache-restart
{% else %}
- 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 %}



+ 4
- 0
apache/manage_security.sls View File

- 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:

+ 4
- 0
apache/mod_actions.sls View File

- 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 %}

+ 4
- 0
apache/mod_cgi.sls View File

- 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 %}

+ 8
- 0
apache/mod_dav_svn.sls View File

- 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:
- 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 %}

+ 10
- 0
apache/mod_fastcgi.sls View File

- 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:
- 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 %}



+ 4
- 0
apache/mod_fcgid.sls View File

- 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 %}

+ 5
- 1
apache/mod_geoip.sls View File

- {{ 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:

+ 4
- 0
apache/mod_headers.sls View File

- 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 %}

+ 16
- 0
apache/mod_mpm.sls View File

- 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
- 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 %}
- 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 %}
- 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 %}

+ 4
- 0
apache/mod_pagespeed.sls View File

- 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'] %}

+ 14
- 0
apache/mod_perl2.sls View File

- 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:
- 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" %}


- 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 %}

+ 12
- 0
apache/mod_php5.sls View File

- 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:
- 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
- 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 %}



+ 8
- 0
apache/mod_proxy.sls View File

- 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:
- 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 %}

+ 4
- 0
apache/mod_proxy_fcgi.sls View File

- 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 %}

+ 8
- 0
apache/mod_proxy_http.sls View File

- 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:
- 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 %}

+ 16
- 0
apache/mod_remoteip.sls View File

- 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:
- 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:
- 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 %}


- 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 %}

+ 8
- 0
apache/mod_rewrite.sls View File

- 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" %}


- 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 %}

+ 20
- 0
apache/mod_security/init.sls View File

- 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:
- 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 %}
- 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" %}
- 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 %}

+ 4
- 0
apache/mod_socache_shmcb.sls View File

- 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



+ 24
- 0
apache/mod_ssl.sls View File

- 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:
- 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" %}
- 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 %}


- 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:
- 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 %}

+ 4
- 0
apache/mod_suexec.sls View File

- 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 %}

+ 4
- 0
apache/mod_vhost_alias.sls View File

- 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 %}

+ 12
- 0
apache/mod_wsgi.sls View File

- 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 }}:
- 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 %}

+ 10
- 0
apache/mod_xsendfile.sls View File

- 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:
- 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 %}



+ 24
- 0
apache/modules.sls View File

- 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', []) %}
- 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" %}
- 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', []) %}
- 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' %}
- 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', []) %}
- 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 %}

+ 4
- 0
apache/no_default_vhost.sls View File

- 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 %}

+ 4
- 0
apache/own_default_vhost.sls View File

- 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 %}

+ 4
- 0
apache/register_site.sls View File

- 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 %}
########################################## ##########################################

+ 4
- 0
apache/vhosts/cleanup.sls View File

- 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 %}

+ 12
- 0
apache/vhosts/standard.sls View File

- 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:
- 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:
- 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 %}



Loading…
Cancel
Save