On 09/08/2014 05:29 PM, omfg9899 wrote:
> puppet apply --configprint modulepath
> /etc/puppet/modules:/usr/share/puppet/modules
>
> puppet apply --configprint environmentpath
> invalid parameter: environmentpath
>
>
>
> I inherited this, and am thinking more and more that it wasn't
> implemented anywhere close to best practices.
> So the environmentpath seems to have been deprecated from what I read.
No, you got that backwards. Modulepath is deprecated in favor of
environmentpath, but your Puppet version does not yet support that.
Which is fine, it's a rather new feature.
> Based on the on the "puppet apply --configprint modulepath", surely
> placing these factor files in either of directories wouldn't make a
> difference?
What makes you say that?
On the contrary, /etc/puppet/modules/env/lib/facter/environment_class.rb
should have definitely worked, because Puppet would pick up the "env"
module and locate the lib/facter/environment_class.rb fact.
When the code is placed there, can you make double sure that these do
not work?
puppet apply -e 'notify { $environment_class: }'
facter -p | grep environment_class
(When writing this I realized that your file used to be named "envir.rb"
which was another mistake - it must be named after the fact I think).
> I think the following may have worked, but it seems hacky and I need
> to do further tesitng.
> "export FACTERLIB="/var/els/puppet/modules/env/lib/facter";
> /usr/bin/puppet apply /var/els/puppet/manifests/site.pp --modulepath
> /var/els/puppet/modules --debug"
Well, the proper way to do this would be
FACTERLIB=/var/els/puppet/modules/env/lib/facter puppet apply
/var/els/puppet/manifests/site.pp --modulepath /var/els/puppet/modules
And yes, it's hardly ideal.
> After running that it "appears" that the new fact is there. I am going
> to do a test build and see if it works.
Meh. Try with the corrected file name in the proper module location.
If you want to stick to /var/els, add the following to your puppet.conf
[main]
modulepath=/var/els/puppet/modules
But then, you likely have more stuff there, so perhaps you even want to
override $configdir or another deeply rooted config value.
Good luck.