reclass and jinja template
Stephan de Bot
stephan at b-it.org
Sat Jul 25 11:23:04 CEST 2015
All,
I have a question regarding reclass and jinja templates. I have a salt state to configure my resolv.conf. The state contains a jinja template
{%- for nameserver in nameservers %}
nameserver {{ nameserver }}
{%- endfor %}
In reclass I have defined a hosted at lication.yml which contains 2 nameservers:
resolver:
searchpaths:
- b-it.internal
nameservers:
- 192.168.1.1
- 192.168.1.2
and on host level I added
resolver:
nameservers:
- 192.168.1.3
When defining it in this way and I perform a salt-call pillar.items it get:
resolver:
----------
nameservers:
- 192.168.1.1
- 192.168.1.2
- 192.168.1.3
So the entry on hostlevel does not override the on hosted@ level.
When I run the state I get all 3 nameservers in resolv.conf.
When I define the nameserver in reclass in a different way on hosted@ level:
resolver:
searchpaths:
b-it.internal
nameservers:
192.168.1.1
192.168.1.2
And on host level:resolver:
nameservers:
192.168.1.3
Reclass does override the nameserver on host level and the salt-call pillar.items looks like this:
nameservers:
192.168.1.3
The state however transfors the output of reclass into the following resolv.conf.
+nameserver 1
+nameserver 9
+nameserver 2
+nameserver .
+nameserver 1
+nameserver 6
+nameserver 8
+nameserver .
+nameserver 1
+nameserver .
+nameserver 3
Does anyone has a solution to fix this?
Kind Regards,
Stephan de Bot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pantsfullofunix.net/pipermail/reclass/attachments/20150725/5322e276/attachment.html>
More information about the reclass
mailing list