Swati Tiwari
2009-Jun-19 22:59 UTC
[Puppet Users] exec "sudo apt-get -t unstable install rubygems" fails!
Hi Everyone, I am trying to install the latest unstable binary of rubygems using the following exec exec { "latestrubygems": command => "sudo apt-get -t unstable install rubygems" } I have the apt.conf and the sources.list file updated correctly for this command to work. This command works well on the command line but not through puppet. I am not sure where I am going wrong.. The output is err: //Node[labserver4]/gempackages/Exec[latestrubygems]/returns: change from notrun to 0 failed: sudo apt-get -t unstable install rubygems returned 1 instead of 0 at /etc/puppet/manifests/classes/gempackages.pp:87 Please guide me if I am going wrong somewhere.. Thanks a lot! -- Regards, Swati --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier
2009-Jun-20 17:11 UTC
[Puppet Users] Re: exec "sudo apt-get -t unstable install rubygems" fails!
Hi> I am trying to install the latest unstable binary of rubygems using the > following exec > > exec { "latestrubygems": > command => "sudo apt-get -t unstable install rubygems" > } > > I have the apt.conf and the sources.list file updated correctly for this > command to work. This command works well on the command line but not through > puppet. I am not sure where I am going wrong.. The output is > > err: //Node[labserver4]/gempackages/Exec[latestrubygems]/returns: change > from notrun to 0 failed: sudo apt-get -t unstable install rubygems returned > 1 instead of 0 at /etc/puppet/manifests/classes/gempackages.pp:87 > > Please guide me if I am going wrong somewhere.. Thanks a lot!sudo might be the problem, as well the environment. why do you need sudo at all? cheers pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Joe McDonagh
2009-Jun-20 18:55 UTC
[Puppet Users] Re: exec "sudo apt-get -t unstable install rubygems" fails!
Peter Meier wrote:> Hi > > >> I am trying to install the latest unstable binary of rubygems using the >> following exec >> >> exec { "latestrubygems": >> command => "sudo apt-get -t unstable install rubygems" >> } >> >> I have the apt.conf and the sources.list file updated correctly for this >> command to work. This command works well on the command line but not through >> puppet. I am not sure where I am going wrong.. The output is >> >> err: //Node[labserver4]/gempackages/Exec[latestrubygems]/returns: change >> from notrun to 0 failed: sudo apt-get -t unstable install rubygems returned >> 1 instead of 0 at /etc/puppet/manifests/classes/gempackages.pp:87 >> >> Please guide me if I am going wrong somewhere.. Thanks a lot! >> > > sudo might be the problem, as well the environment. why do you need sudo > at all? > > cheers pete > > > > >Not only is sudo unnecessary, you need to either set the path parameter, or full qualify your executables in an exec resource, ie /usr/bin/apt-get -t unstable install rubygems. Also, you''ll want an onlyif in there, otherwise it''ll execute every puppet run. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Swati Tiwari
2009-Jun-22 17:58 UTC
[Puppet Users] Re: exec "sudo apt-get -t unstable install rubygems" fails!
I have my default path set, so I am sure that is not a problem and I also have an onlyif in there... I need sudo because right now in an experimental set up I do not have root privileges :(.. I will try to tweak it a bit.. Thanks to you guys anyway! 2009/6/20 Joe McDonagh <joseph.e.mcdonagh@gmail.com>> > Peter Meier wrote: > > Hi > > > > > >> I am trying to install the latest unstable binary of rubygems using the > >> following exec > >> > >> exec { "latestrubygems": > >> command => "sudo apt-get -t unstable install rubygems" > >> } > >> > >> I have the apt.conf and the sources.list file updated correctly for this > >> command to work. This command works well on the command line but not > through > >> puppet. I am not sure where I am going wrong.. The output is > >> > >> err: //Node[labserver4]/gempackages/Exec[latestrubygems]/returns: change > >> from notrun to 0 failed: sudo apt-get -t unstable install rubygems > returned > >> 1 instead of 0 at /etc/puppet/manifests/classes/gempackages.pp:87 > >> > >> Please guide me if I am going wrong somewhere.. Thanks a lot! > >> > > > > sudo might be the problem, as well the environment. why do you need sudo > > at all? > > > > cheers pete > > > > > > > > > > > Not only is sudo unnecessary, you need to either set the path parameter, > or full qualify your executables in an exec resource, ie > /usr/bin/apt-get -t unstable install rubygems. Also, you''ll want an > onlyif in there, otherwise it''ll execute every puppet run. > > > >-- Regards, Swati --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
RijilV
2009-Jun-22 19:38 UTC
[Puppet Users] Re: exec "sudo apt-get -t unstable install rubygems" fails!
2009/6/22 Swati Tiwari <its.svati@gmail.com>> > > >> >> Not only is sudo unnecessary, you need to either set the path parameter, >> or full qualify your executables in an exec resource, ie >> /usr/bin/apt-get -t unstable install rubygems. Also, you''ll want an >> onlyif in there, otherwise it''ll execute every puppet run. >> >>do you have "requiretty" in your sudoers file? try running puppet with --debug --test and look at the actual error message from the command puppet is attempting to run. .r'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Swati Tiwari
2009-Jun-22 20:16 UTC
[Puppet Users] Re: exec "sudo apt-get -t unstable install rubygems" fails!
This is the output with the --debug flag. notice: //Node[labserver5]/gempackages/File[/etc/apt/apt.conf]/ensure: created debug: //Node[labserver5]/gempackages/Linetobeappended[toapt.conf]/Exec[/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt/apt.conf'']: Executing check ''/bin/grep -qFx ''APT::Default-Release "stable";'' ''/etc/apt/apt.conf'''' debug: Executing ''/bin/grep -qFx ''APT::Default-Release "stable";'' ''/etc/apt/apt.conf'''' debug: //Node[labserver5]/gempackages/Linetobeappended[toapt.conf]/Exec[/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt/apt.conf'']: Changing returns debug: //Node[labserver5]/gempackages/Linetobeappended[toapt.conf]/Exec[/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt/apt.conf'']: 1 change(s) debug: //Node[labserver5]/gempackages/Linetobeappended[toapt.conf]/Exec[/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt/apt.conf'']: Executing ''/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt/apt.conf'''' debug: Executing ''/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt/apt.conf'''' notice: //Node[labserver5]/gempackages/Linetobeappended[toapt.conf]/Exec[/bin/echo ''APT::Default-Release "stable";'' >> ''/etc/apt /apt.conf'']/returns: executed successfully debug: //Node[labserver5]/gempackages/Linetobeappended[tosources.list]/Exec[/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'']: Executing check ''/bin/grep -qFx ''deb http://http.us.debian.org/debian unstable main contrib non-free'' ''/etc/apt/sources.list'''' debug: Executing ''/bin/grep -qFx ''deb http://http.us.debian.org/debianunstable main contrib non-free'' ''/etc/apt/sources.list'''' debug: //Node[labserver5]/gempackages/Linetobeappended[tosources.list]/Exec[/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'']: Changing returns debug: //Node[labserver5]/gempackages/Linetobeappended[tosources.list]/Exec[/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'']: 1 change(s) debug: //Node[labserver5]/gempackages/Linetobeappended[tosources.list]/Exec[/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'']: Executing ''/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'''' debug: Executing ''/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'''' notice: //Node[labserver5]/gempackages/Linetobeappended[tosources.list]/Exec[/bin/echo ''deb http://http.us.debian.org/debian unstable main contrib non-free'' >> ''/etc/apt/sources.list'']/returns: executed successfully debug: //Node[labserver5]/gempackages/Exec[aptupdate]: Changing returns debug: //Node[labserver5]/gempackages/Exec[aptupdate]: 1 change(s) debug: //Node[labserver5]/gempackages/Exec[aptupdate]: Executing ''sudo apt-get update'' debug: Executing ''sudo apt-get update'' notice: //Node[labserver5]/gempackages/Exec[aptupdate]/returns: executed successfully debug: //Node[labserver5]/gempackages/Exec[latestrubygems]: Executing check ''sudo gem update'' debug: Executing ''sudo gem update'' debug: //Node[labserver5]/gempackages/Exec[latestrubygems]: Changing returns debug: //Node[labserver5]/gempackages/Exec[latestrubygems]: 1 change(s) debug: //Node[labserver5]/gempackages/Exec[latestrubygems]: Executing ''/usr/bin/sudo /usr/bin/apt-get -t unstable install rubygems'' debug: Executing ''/usr/bin/sudo /usr/bin/apt-get -t unstable install rubygems'' err: //Node[labserver5]/gempackages/Exec[latestrubygems]/returns: change from notrun to 0 failed: /usr/bin/sudo /usr/bin/apt-get -t unstable install rubygems returned 1 instead of 0 at /etc/puppet/manifests/classes/gempackages.pp:87 When I do a sudo apt-get update, it works fine, whats the deal with the unstable install? 2009/6/22 RijilV <rijilv@riji.lv>> 2009/6/22 Swati Tiwari <its.svati@gmail.com> > >> >> > >>> >>> Not only is sudo unnecessary, you need to either set the path parameter, >>> or full qualify your executables in an exec resource, ie >>> /usr/bin/apt-get -t unstable install rubygems. Also, you''ll want an >>> onlyif in there, otherwise it''ll execute every puppet run. >>> >>> > do you have "requiretty" in your sudoers file? > > try running puppet with --debug --test and look at the actual error message > from the command puppet is attempting to run. > > > .r'' > > > > > >-- Regards, Swati --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---