Re: how to connect agent to the master through a different user to execute a command through puppet module

26 views
Skip to first unread message

Nick Fagerlund

unread,
Aug 22, 2012, 1:25:39 PM8/22/12
to puppet...@googlegroups.com
I don't understand what you're doing. But it sounds like you might need the "user" attribute of the exec type?

exec {'some command':
  user => 'admin',
}

See http://docs.puppetlabs.com/references/latest/type.html#exec and scroll down a bit.

On Wednesday, August 22, 2012 2:50:28 AM UTC-7, Prosenjit Ghosh wrote:
Created a puppet master in one Linux.X64/rh50 machine.
Created a puppet agent in another Linux.X64/rh50 machine.

Need to run any command from puppet master and that will execute in puppet agent when puppet agent will connect to puppet master.

This is happening correctly for me when created master and agent through root user.

But I need to execute a command that wont allow root user. I need any user except root. I tried successfully to create puppet master through a different user. But not able to execute the command when connecting the agent through that different user.

Any suggestion on this how to connect agent to the master through a different user to execute a command through puppet module

Prosenjit Ghosh

unread,
Aug 23, 2012, 2:06:23 AM8/23/12
to puppet...@googlegroups.com
Thanks so much for your time.
WIll try that.
Actually we have written a module on puppet-master which will run one
command (Installer command) on agent node when any agent connects to
the master.
This command wont work if this has root permission.
So we install and configure puppet master and agent using some other
user except "root". This worked successfully.
Now we are not able to connect the agent to the puppet master using
this different user except "root". This is the problem.
Anyway we will give this a try as per your suggestion.

And also thanks very much for our help.

Thanks
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/Y2EWm3dKGIUJ.
>
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Prosenjit Ghosh

unread,
Aug 23, 2012, 9:05:20 AM8/23/12
to puppet...@googlegroups.com
Hi Nick,

Your suggestion is not working.

Actually when we try to connect the agent to the puppet through a
different user, no ssl directory got created under /var/lib/puppet in
agent side.

Can you provide some light on this.

Your help would be most appreciated.

Thanks
Prosenjit

jcbollinger

unread,
Aug 27, 2012, 3:12:34 PM8/27/12
to puppet...@googlegroups.com


On Thursday, August 23, 2012 8:05:20 AM UTC-5, Prosenjit Ghosh wrote:
Hi Nick,

Your suggestion is not working.

Actually when we try to connect the agent to the puppet through a
different user, no ssl directory got created under /var/lib/puppet in
agent side.

Can you provide some light on this.


The agent must run as a privileged user, typically root, in order to be able to do its work.  That work might include, for example, applying an Exec resource, such as one that runs your installer.  If such an Exec's 'user' parameter is set, then the agent will assume the identity of the specified user while running the command.  You do not need the agent overall to run as that user.


John

Reply all
Reply to author
Forward
0 new messages