saltstack-formulas / apache-formula

Set up and configure the Apache HTTP server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
50 stars 284 forks source link

CentOS: Rendering failed - has no attribute 'version' #247

Closed 9numbernine9 closed 5 years ago

9numbernine9 commented 5 years ago

Hello!

I'm attempting to use the latest Apache formula since the changes in commit 094b149262 and I think something has broken when used on CentOS 7. Attempting to use the formula on a minion where it previously worked now results in the following:

my-minion-here:
    Data failed to compile:
---------------
    Rendering SLS 'base:apache.config' failed: Jinja variable 'dict object' has no attribute 'version'

Looking into this a bit deeper: apache/map.jinja is merging the osfingermap by using the grain oscodename - given that this is the 'finger map', shouldn't this use the osfinger grain instead?

FWIW, the minion that I'm using this formula on returns the following relevant grain information:

  os_family:
    RedHat
  osarch:
    x86_64
  oscodename:
    CentOS Linux 7 (Core)
  osfinger:
    CentOS Linux-7
  osfullname:
    CentOS Linux
  osmajorrelease:
    7

The value for CentOS 7 in apache/osfingermap.yaml matches the value for osfinger on my CentOS 7 minion, which is why I think the osfingermap should probably be populated based on osfinger instead of oscodename. :-)

I see a couple possible fixes:

aboe76 commented 5 years ago

@9numbernine9 you are right made a copy paste error with osfinger.

too bad our automated testing with kitchen salt didn't catch it.

9numbernine9 commented 5 years ago

@aboe76 No problem - thanks for providing a fix and helping me verify my sanity. :-)

aboe76 commented 5 years ago

yeah it was late, and I missed it, sorry.

9numbernine9 commented 5 years ago

All good!