Skip to content

Commit 9a1b1d9

Browse files
scambraaboe76
authored andcommitted
Patch upload progress (#267)
* Include the mod_* states in apache.modules for Debian hosts * upload progress module for debian
1 parent d660abf commit 9a1b1d9

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

apache/mod_upload_progress.sls

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% from "apache/map.jinja" import apache with context %}
2+
3+
{% if grains['os_family']=="Debian" %}
4+
include:
5+
- apache
6+
7+
libapache2-mod-upload-progress:
8+
pkg.installed
9+
10+
a2enmod upload_progress:
11+
cmd.run:
12+
- unless: ls /etc/apache2/mods-enabled/upload_progress.load
13+
- order: 255
14+
- require:
15+
- pkg: libapache2-mod-upload-progress
16+
- watch_in:
17+
- module: apache-restart
18+
- require_in:
19+
- module: apache-restart
20+
- module: apache-reload
21+
- service: apache
22+
{% endif %}

apache/modules.sls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22

33
include:
44
- apache
5+
{%- set existing_states = salt['cp.list_states']() %}
6+
{%- for module in salt['pillar.get']('apache:modules:enabled', []) %}
7+
{%- set mod_state = 'apache.mod_{}'.format(module) %}
8+
{%- if mod_state in existing_states %}
9+
- {{ mod_state }}
10+
{%- endif %}
11+
{%- endfor %}
512

613
{% for module in salt['pillar.get']('apache:modules:enabled', []) %}
14+
{% if module not in existing_states %}
715
a2enmod {{ module }}:
816
cmd.run:
917
- unless: ls /etc/apache2/mods-enabled/{{ module }}.load
@@ -16,6 +24,7 @@ a2enmod {{ module }}:
1624
- module: apache-restart
1725
- module: apache-reload
1826
- service: apache
27+
{% endif %}
1928
{% endfor %}
2029

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

0 commit comments

Comments
 (0)