2

I'm currently running multiple load-balanced masters and need to debug some differences between them.

Is there a good way to include the hostname or some other ID of the puppet master in the agent reports? (Putting slightly different code on each master is not an option for me)

2 Answers 2

2

The Puppet master will inject variables such as $servername to the catalog compilation, which are listed at Puppet master variables.

You could include these in reports by using notify { "Compiled on $servername": } in one of your manifests, or adding it to a file template (e.g. MOTD).

Another mechanism would be to change the config_version - a unique name/number given to each catalog compilation, often used to show the current git/SCM revision of the manifests being built. By default it shows the current Unix epoch. You could change this to return the epoch and master hostname.

config_version is usually set per-environment, e.g. using environment.conf: config_version in environment.conf, and can point to a script that you deploy to every master and that outputs a string including the server's hostname.

0

By binding your clients with an entry in /etc/hosts directly to one of your puppet master, you can test a certain puppet-master.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .