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