From 5550f85bd97862a0c811763bf70e31c2e7da634a Mon Sep 17 00:00:00 2001 From: Seth House Date: Tue, 13 Aug 2013 16:51:38 -0600 Subject: [PATCH] Added a mod_wsgi state --- README.rst | 2 ++ apache/mod_wsgi.sls | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 apache/mod_wsgi.sls diff --git a/README.rst b/README.rst index bc1c7b6..ef1dedf 100644 --- a/README.rst +++ b/README.rst @@ -13,6 +13,8 @@ Available states ``apache`` Installs the Apache package and starts the service. +``apache.mod_wsgi`` + Installs the mod_wsgi package and enables the Apache module. ``apache.debian_full`` Installs and configures Apache on Debian and Ubuntu systems. diff --git a/apache/mod_wsgi.sls b/apache/mod_wsgi.sls new file mode 100644 index 0000000..9ce74d6 --- /dev/null +++ b/apache/mod_wsgi.sls @@ -0,0 +1,18 @@ +{% set pkg = salt['grains.filter_by']({ + 'Debian': {'name': 'libapache2-mod-wsgi'}, + 'RedHat': {'name': 'mod_wsgi'}, +}) %} + +mod_wsgi: + pkg: + - installed + - name: {{ pkg.name }} + +{% if grains.get('os_family') == 'RedHat' %} +/etc/httpd/conf.d/wsgi.conf: + file: + - uncomment + - regex: LoadModule + - require: + - pkg: mod_wsgi +{% endif %}