From e5c1209433e617160ee5cdeba9c2d399a4945c36 Mon Sep 17 00:00:00 2001 From: Brad Thurber Date: Tue, 25 Aug 2015 15:38:16 -0400 Subject: [PATCH] This branch is foundational for further version-specific work to come. * Add apache version (2.2, 2.4) detection based on osfinger (defaults to 2.4). * Version can be overridden in pillar (for Apache 2.4 on RHEL 6 for example) --- apache/map.jinja | 7 ++++++- apache/osfingermap.yaml | 6 ++++++ pillar.example | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 apache/osfingermap.yaml diff --git a/apache/map.jinja b/apache/map.jinja index 7ce2ba5..1a116a4 100644 --- a/apache/map.jinja +++ b/apache/map.jinja @@ -1,3 +1,5 @@ +{% import_yaml "apache/osfingermap.yaml" as osfingermap %} + {% set apache = salt['grains.filter_by']({ 'Debian': { 'server': 'apache2', @@ -88,4 +90,7 @@ 'default_site_ssl': 'default-ssl.conf', 'use_require': True, }, -}, grain='oscodename', merge=salt['pillar.get']('apache:lookup'))) %} +}, grain='oscodename', merge=salt['grains.filter_by']( + osfingermap +, grain='osfinger', merge=salt['pillar.get']('apache:lookup')))) %} + diff --git a/apache/osfingermap.yaml b/apache/osfingermap.yaml new file mode 100644 index 0000000..adc4fa5 --- /dev/null +++ b/apache/osfingermap.yaml @@ -0,0 +1,6 @@ +default: + version: '2.4' +Red Hat Enterprise Linux Server-6: + version: '2.2' +Red Hat Enterprise Linux Server-7: + version: '2.4' \ No newline at end of file diff --git a/pillar.example b/pillar.example index a2d83ab..a8c7a51 100644 --- a/pillar.example +++ b/pillar.example @@ -11,6 +11,9 @@ apache: confext: .conf logdir: /var/log/apache2 wwwdir: /srv/apache2 + + # apache version (generally '2.2' or '2.4') + version: '2.2' # ``apache.mod_wsgi`` formula additional configuration: mod_wsgi: mod_wsgi