Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2012 19:44
Show Gist options
  • Save anonymous/2912233 to your computer and use it in GitHub Desktop.
Save anonymous/2912233 to your computer and use it in GitHub Desktop.
Apache module macro for salt
{% macro a2mod(module, enabled=true) -%}
{% if enabled %}
a2enmod {{ module }}:
cmd:
- run
- unless: test -L /etc/apache2/mods-enabled/{{ module }}.load
- require:
- pkg: apache2
- watch_in:
- service: apache2
{% else %}
a2dismod {{ module }}:
cmd:
- run
- unless: test ! -L /etc/apache2/mods-enabled/{{ module }}.load
- require:
- pkg: apache2
- watch_in:
- service: apache2
{% endif %}
{%- endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment