Chadwick Banning
2013-Sep-25 19:21 UTC
[Puppet Users] Facts distributed via module missing when Puppet is run out of a cron job
Hi all, I have the following fact to get the full path of the Puppet executable being distributed via a module: Facter.add("puppet_executable") do> setcode do > Facter::Util::Resolution.exec(''/usr/bin/which puppet'') > end > end >This fact is used to set the command attribute of the cron job to execute puppet. The facts exists perfectly when manually running puppet agent but disappears when puppet executes out of a cron job. Is this normal behavior? I had to switch over to using external facts to work around this issue. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Ramin K
2013-Sep-25 20:05 UTC
Re: [Puppet Users] Facts distributed via module missing when Puppet is run out of a cron job
man which DESCRIPTION which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow symbolic links. Your PATH is not the same (probably empty) when you run from cron. I''d determine the path to Puppet some other way. Ramin On 9/25/2013 12:21 PM, Chadwick Banning wrote:> Hi all, > > I have the following fact to get the full path of the Puppet executable > being distributed via a module: > > Facter.add("puppet_executable") do > setcode do > Facter::Util::Resolution.exec(''/usr/bin/which puppet'') > end > end > > > This fact is used to set the command attribute of the cron job to > execute puppet. The facts exists perfectly when manually running puppet > agent but disappears when puppet executes out of a cron job. Is this > normal behavior? I had to switch over to using external facts to work > around this issue.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.