Hi everyone, we just found out that when invoking puppet with sudo on redhat/centos (with no magic bash_completion), some providers don''t get recognized due to missing absolute path for the provider''s command. for example: useradd has in /usr/lib/site_ruby/1.8/puppet/provider/user/useradd.rb: commands :add => "useradd", :delete => "userdel", :modify => "usermod" it doesn''t work if pupet invoked via sudo whereas chkconfig in /usr/lib/site_ruby/1.8/puppet/provider/service/redhat.rb: commands :chkconfig => "/sbin/chkconfig" works... would it be possible to add absolute paths for the providers definitions? cheers, Massimo
massiv wrote:> Hi everyone, > we just found out that when invoking puppet with sudo on > redhat/centos (with no magic bash_completion), some providers don''t get > recognized due to missing absolute path for the provider''s command.It''s probably easier to just set the path before you run puppet, or configure sudo to set it to a known safe value (if compiled with the SAVE_PATH option). Eg: sudo env PATH=/sbin:/bin:/usr/sbin:/usr/bin puppetd ...
On Aug 23, 2007, at 7:23 AM, cez@necrofish.org.uk wrote:> > It''s probably easier to just set the path before you run puppet, or > configure sudo to set it to a known safe value (if compiled with the > SAVE_PATH option). Eg: > > sudo env PATH=/sbin:/bin:/usr/sbin:/usr/bin puppetd ...Or even sudo puppetd --path=/sbin:/bin... Basically, we don''t always know the path on the destination system, so we can''t manually set them. It''s also easy enough to configure your sudo binary to have a reasonable path -- just set your sudoers file up correctly. -- I have never met a man so ignorant that I couldn''t learn something from him. --Galileo Galilei --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/23/07, Luke Kanies <luke@madstop.com> wrote:> Or even sudo puppetd --path=/sbin:/bin...What about setting the path in the puppet manifest itself? Exec { path => "/usr/bin:/usr/sbin/:/bin:/sbin" }
On Aug 23, 2007, at 10:16 AM, Joshua Timberman wrote:> > What about setting the path in the puppet manifest itself? > > Exec { path => "/usr/bin:/usr/sbin/:/bin:/sbin" }That works for exec, but not for other types. -- Finn''s Law: Uncertainty is the final test of innovation. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com