salt-formulas / salt-formula-iptables

Other
7 stars 18 forks source link

Pillar that cointains string variables throw jinja error #15

Closed ppieprzycki closed 6 years ago

ppieprzycki commented 6 years ago

Fix for situation that we discovered in our environment. We have in pillar variables that comes from external systems. Those variables are string. In file rules.sls there is if that expect that all variables are dict

Example of a pillar that throws error

example pilar

my_value: 'string' iptables: service: ..

[dev] ROOT@dev-01:~# salt-call state.apply iptables test=true [INFO ] Loading fresh modules for state activity [ERROR ] Rendering exception occurred: Jinja variable 'str object' has no attribute 'get' [CRITICAL] Rendering SLS 'dev_env:iptables.rules' failed: Jinja variable 'str object' has no attribute 'get' local: Data failed to compile: Rendering SLS 'dev_env:iptables.rules' failed: Jinja variable 'str object' has no attribute 'get'