Hello!
We used version 2.13.
We have several zones and each has its own constants.conf file with certain constants, for example:
We used version 2.13.
We have several zones and each has its own constants.conf file with certain constants definition, for example:
MONGO_PASS=“1111”
MYSQL_PASS=“222”
the values of these constants are different for all zones.
After upgrading to version 2.14 we get the error
“Value for constant was modified. This behaviour is deprecated”
Questions:
Do I understand correctly that constants need to be changed to variables? 2. What is the best way to do this? Should I put the definition of these variables in each zone’s hosts.conf? Or is there an alternative way?
Thanks
you could create multiple hosttemplates that contain the different passwords and assign the right template to the corresponding host.
the templates can inherit from a template so values can be overwritten in the child templates
IMHO global constants aren’t a good fit for configuration information that isn’t static and globally valid.
I would second the advice of @moreamazingnick and putt stuff like the mongo credentials into host vars.
This would also increase security as I expect that your current method exposes the mongo credentials on ALL hosts with an Icinga2 agent in the zone under /var/lib/icinga2/api/zones/! The same is a concern for templates!