Browse Source

Patch upload progress (#267)

* Include the mod_* states in apache.modules for Debian hosts

* upload progress module for debian
tags/v0.37.4
Sergio Cambra 5 years ago
parent
commit
9a1b1d9b26
2 changed files with 31 additions and 0 deletions
  1. +22
    -0
      apache/mod_upload_progress.sls
  2. +9
    -0
      apache/modules.sls

+ 22
- 0
apache/mod_upload_progress.sls View File

{% from "apache/map.jinja" import apache with context %}

{% if grains['os_family']=="Debian" %}
include:
- apache

libapache2-mod-upload-progress:
pkg.installed

a2enmod upload_progress:
cmd.run:
- unless: ls /etc/apache2/mods-enabled/upload_progress.load
- order: 255
- require:
- pkg: libapache2-mod-upload-progress
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
{% endif %}

+ 9
- 0
apache/modules.sls View File



include: include:
- apache - apache
{%- set existing_states = salt['cp.list_states']() %}
{%- for module in salt['pillar.get']('apache:modules:enabled', []) %}
{%- set mod_state = 'apache.mod_{}'.format(module) %}
{%- if mod_state in existing_states %}
- {{ mod_state }}
{%- endif %}
{%- endfor %}


{% for module in salt['pillar.get']('apache:modules:enabled', []) %} {% for module in salt['pillar.get']('apache:modules:enabled', []) %}
{% if module not in existing_states %}
a2enmod {{ module }}: a2enmod {{ module }}:
cmd.run: cmd.run:
- unless: ls /etc/apache2/mods-enabled/{{ module }}.load - unless: ls /etc/apache2/mods-enabled/{{ module }}.load
- module: apache-restart - module: apache-restart
- module: apache-reload - module: apache-reload
- service: apache - service: apache
{% endif %}
{% endfor %} {% endfor %}


{% for module in salt['pillar.get']('apache:modules:disabled', []) %} {% for module in salt['pillar.get']('apache:modules:disabled', []) %}

Loading…
Cancel
Save