How to access application level variables in Puppet
I know this question can be open to interpretation so I will ask for specifics.
I am leveraging Puppet to keep some application level variables and settings in check. The problem I am having is a lot of these variables are not set in facts like things like operatingsystem, hostname, ipaddress, etc. I am then having trouble trying to figure out how to leverage puppet to create variables to act on.
For example, I have some servers that are running different versions of an application and so I need to be able to figure out what version is running on the server. How can I do this?
My first thoughts are that since these facts are not provided in the standard facts list that I should create facts of my own that I can leverage and so I am doing something like the following:
module_name | |---manifests |---files |---examples |---facts.d |---script.sh
In my script.sh I am executing linux commands to get variables from the application. and then echoing them out in the format
So where the application version is stored I would find that location and then echo out the version. Then at runtime I can use a variable like $app_ver to make specific configuration changes. Such as
- Is this the correct way of defining external facts?
- Are there standard ways of getting Application-Level details?
- When puppet applies on a given app server, will the script.sh run, provide facts and then make those variables available to the puppet master to determine config changes?
- Will the computation in the script.sh file have to run on every server that matches this class?