From 9a1b1d9b26a05825324c3ad98f0746995436072b Mon Sep 17 00:00:00 2001 From: Sergio Cambra Date: Thu, 26 Sep 2019 17:57:24 +0200 Subject: [PATCH] Patch upload progress (#267) * Include the mod_* states in apache.modules for Debian hosts * upload progress module for debian --- apache/mod_upload_progress.sls | 22 ++++++++++++++++++++++ apache/modules.sls | 9 +++++++++ 2 files changed, 31 insertions(+) create mode 100644 apache/mod_upload_progress.sls diff --git a/apache/mod_upload_progress.sls b/apache/mod_upload_progress.sls new file mode 100644 index 0000000..78947ed --- /dev/null +++ b/apache/mod_upload_progress.sls @@ -0,0 +1,22 @@ +{% 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 %} diff --git a/apache/modules.sls b/apache/modules.sls index 1594724..2b8d64f 100644 --- a/apache/modules.sls +++ b/apache/modules.sls @@ -2,8 +2,16 @@ include: - 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', []) %} +{% if module not in existing_states %} a2enmod {{ module }}: cmd.run: - unless: ls /etc/apache2/mods-enabled/{{ module }}.load @@ -16,6 +24,7 @@ a2enmod {{ module }}: - module: apache-restart - module: apache-reload - service: apache +{% endif %} {% endfor %} {% for module in salt['pillar.get']('apache:modules:disabled', []) %}