Hi Prudhvi,

though I'm a Puppet newbie I do think indeed that the puppetd usually
is run as user root
because most configuration changes do require root privileges.

Was there any particular reason why you instead have your puppetd run
as user puppet?

Anyway, I would assume that in this case the user puppet requires a
sudoers rule on that host
that allows him to install packages system wide via apt (or any other
packaging tool)

At least I would think some entry like (as root execute "visudo")
(please, note I am not familiar with debianish systems as we use
redhattish ones, so my path assumption may be wrong)

puppet  ALL = NOPASSWD: /usr/sbin/apt-get


or more specific


puppet <hostname> = NOPASSWD: /usr/sbin/apt-get update



You should probably check for prevalent sudoers rules of user puppet
by e.g.

#  su puppet -c sudo\ -l



On May 27, 11:37 am, prudhvi <prudh...@gmail.com> wrote:
> Hi All,
>
> When I try to run any sudo commands like the below
>
> class test {
> exec { "sudocmd" :
>     cwd => "/home/server/",
>     path => ["/usr/bin/","/usr/sbin/","/bin"],
>     command => "sudo apt-get update",
>     }
>
> }
>
> Im getting the following error
>
> # puppetd --server prudhvi.example.com --test
> info: Caching catalog for node1.example.com
> info: Applying configuration version '1274952926'
> err: //test/Exec[sudocmd]/returns: change from notrun to 0 failed:
> sudo apt-get update returned 1 instead of one of [0] at /etc/puppet/
> manifests/site.pp:15
> notice: Finished catalog run in 0.10 seconds
>
> When i see # top
> puppetd is being run by user puppet
> Is that the problem.
>
> Thanks in advance,
> prudhvi

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to