Skip to content

Commit

Permalink
Patch upload progress (saltstack-formulas#267)
Browse files Browse the repository at this point in the history
* Include the mod_* states in apache.modules for Debian hosts

* upload progress module for debian
  • Loading branch information
scambra authored and aboe76 committed Sep 26, 2019
1 parent d660abf commit 9a1b1d9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions apache/mod_upload_progress.sls
Original file line number Diff line number Diff line change
@@ -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 %}
9 changes: 9 additions & 0 deletions apache/modules.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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', []) %}
Expand Down

0 comments on commit 9a1b1d9

Please sign in to comment.