This branch is intended as a portability fix. Some functionailty had
been inadvertently removed as unused, but testing revealed that it had a
purpose. Because the purpose was unclear, this commit restores the
functionality AND clarifies it in the script names and comments in
config_version.sh.
r10k generates a .r10k-deploy.json file since version 2.1.0 which was
released on October 28, 2015. New users of the control-repo are not
likely to have a so old version of r10k, so remove this dead code.
- Fix shebang: `bash` is not always in `/bin/`, and since the script
does not have bashism, rely on `sh` which is always in `/bin/`;
- Use `/opt/puppetlabs/puppet/bin/ruby` if this file exist and is
executable, otherwise use `ruby` from $PATH;
- Use `code_manager_config_version.rb` if `.r10k-deploy.json` is found,
and `config_version.rb` in all other cases.
Prior to this, the config_version script just showed the commit ID of
the version of code being compiled. This commit includes the compiling
Puppet master's hostname and environment name in the config_version.
This is very useful for debugging when a Puppet master is failing and
you have multiple masters behind a load balancer.
The output of config_version now looks like this:
pupmaster01-production-ac9785273a10