saltstack-formulas/apache-formula

grains[os_family] broken in opensuse LEAP for Salt 2016.3

noelmcloughlin opened this issue · 3 comments

The apache.modules state fails on opensuse LEAP (Salt 2016.3). The critical error message reports Rendering SLS error complaining about Conflicting ID: Location.

The apache.modules state succeeds if following changes are applied. I can do PR.

+++ b/apache/config.sls
@@ -57,7 +57,7 @@ include:
- service: apache
{% endif %}

-{% if grains['os_family']=="Suse" %}
+{% if grains['os_family']=="Suse" or salt'grains.get' == 'SUSE' %}
/etc/apache2/global.conf:
file.managed:
- template: jinja
diff --git a/apache/mod_php5.sls b/apache/mod_php5.sls
index 370e360..93e16a3 100644
--- a/apache/mod_php5.sls
+++ b/apache/mod_php5.sls
@@ -46,7 +46,7 @@ a2enmod php5:

{% endif %}

-{% if grains['os_family']=="Suse" %}
+{% if grains['os_family']=="Suse" or salt'grains.get' == 'SUSE' %}

Interesting the pillar.example defines two "Location" stanzas but one is enough? Separate bug?

I'm going to reopen for PR to fix original SLS Rendering error

This is caused by duplicate Location stanzas in pillar.example it seems.