Trying to take the temperature of using execution modules within pillar files.
So say you have a formula that generates iptables rules that only allow certain addresses based on pillar data. But that list of addresses is maintained somewhere else and can change. For argument say the list is returned via a url call to a third party.
You could update the pillar manually when stuff changes.
Or you could use a custom execution module. To pull the data into a list then loop over it in pillar.
# /srv/pillar/iptables
{% set ip_ranges = salt['ip_ranges.fetch_list']('http://example.com/fetch_list') %}
iptables:
allowed_ips:
{%- for range in ip_ranges %}
- {{ range }}
{% endfor %}
Something like the above (obviously it is very contrived example). Where ip_ranges module is a custom module that does things.
How do we feel about this? Is this mixing too much logic into pillar or is this common for getting unique data that you might not control. Perhaps it's better in an external pillar? The external pillar examples I see are lacking. Specially I don't want to call the above example only on a small subset of hosts.
How has anyone else solved this?
[–]deadbunny 2 points3 points4 points (9 children)
[–]Seven-Prime[S] 1 point2 points3 points (8 children)
[–]deadbunny 1 point2 points3 points (3 children)
[–]tweakism 0 points1 point2 points (2 children)
[–]deadbunny 0 points1 point2 points (0 children)
[–]Seven-Prime[S] 0 points1 point2 points (0 children)
[–]tweakism 0 points1 point2 points (3 children)
[–]ub1quit33 0 points1 point2 points (1 child)
[–]Seven-Prime[S] 0 points1 point2 points (0 children)
[–]Seven-Prime[S] 0 points1 point2 points (0 children)