-
Notifications
You must be signed in to change notification settings - Fork 117
Description
While testing my proposed changes for #125 in possibly encountered a critical bug.
Steps to reproduce
Create a pillar for Zabbx Proxy /srv/pillar/zabbix/proxy.sls and write a value for pidfile, logfile, or dbname:
zabbix-proxy:
pidfile: /tmp/zabbix_proxy.pid
Watch the resultant Pillar values on the minion salt 'zabprox.*' pillar.items they change accordingly:
zabbix-proxy:
----------
pidfile:
/tmp/zabbix_proxy.pid
Make a state apply test salt 'zabprox.*' state.apply test=true and watch that the states do not change at all!
Name: /var/lib/zabbix - Function: file.directory - Result: Clean Started: - 07:28:57.013935 Duration: 0.541 ms
Expected behavior
/srv/formulas/zabbix-formula/zabbix/proxy/init.sls has to read in the pillar not only from /srv/formulas/zabbix-formula/zabbix/map.jinja but also from /srv/pillar/zabbix/proxy.sls and change the file.directory states accordingly.
Partly resoltution
I believe this bug was introduced by @hatifnatt in commit 2907cda and @aboe76 in commit cdf5b80 for example.
I build an example solution that works very well for me and solves also #125 but I don't believe it's the right solution as it seems much too complicated:
/srv/formulas/zabbix-formula/zabbix/proxy/init.sls
{% set logfile = salt['pillar.get']('zabbix-proxy:logfile', zabbix.proxy.logfile) %}
{% set pidfile = salt['pillar.get']('zabbix-proxy:pidfile', zabbix.proxy.pidfile) %}
{% set sqlitedir = salt['pillar.get']('zabbix-proxy:dbname', zabbix.proxy.dname) %}
It can't be the solution, to have a line in the header for each and every folder I have to read in from the pillar, including a fallback to the map.jinja, can it?
I would like to ask for your help so we can solve this together!