LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-15-2010, 05:21 AM   #1
niraj.kumar
LQ Newbie
 
Registered: Nov 2008
Posts: 27

Rep: Reputation: 15
Parameter to execute shell script on puppet client through Puppet server


Dear All,

I have installed a puppet server and its client on Centos.
Puppet server and its client is running fine and its
update whatever changes made on Puppet server is updated
on its client but i am unable to execute script (Bash shell)
on the client through Puppet server. So please advice
a suitable class or parameter for Puppet server so that
it could execute on its client.

Any help would be appreciable.........


Thanks,
Niraj
 
Old 01-12-2011, 05:37 PM   #2
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Lightbulb

Quote:
Originally Posted by niraj.kumar View Post
Dear All,

I have installed a puppet server and its client on Centos.
Puppet server and its client is running fine and its
update whatever changes made on Puppet server is updated
on its client but i am unable to execute script (Bash shell)
on the client through Puppet server. So please advice
a suitable class or parameter for Puppet server so that
it could execute on its client.

Any help would be appreciable.........


Thanks,
Niraj
May be it is too late. But still I also got stuck in it for some time.

Here is the solution

Code:
 
# vi /etc/puppet/manifests/nodes.pp
...
...
class test1 {
exec { "/path/of/script": }
}
 
node box2 {
    include "test1"
}
Run, the below command on Puppet Client i.e. box2 in my case.
Code:
 
puppetd --test --server=box1.test.com

I have box1.test.com as Puppet Server
and
box2.test.com as Puppet Client.
 
Old 02-07-2011, 10:43 PM   #3
unixbhaskar
LQ Newbie
 
Registered: Aug 2005
Location: India
Distribution: Gentoo,Arch ,Fedora,Debian
Posts: 9

Rep: Reputation: 0
Unhappy Is it possible to run the puppet-server and client on same host?

Hi,

Can anyone suggest me how could I run puppet-server and client on same machine(CentOS)?It would be a great help to know the step by step info about it.I have already installed puppet server and client on the same machine and looking for an solution to interact with them successfully on the same machine.

Cheers!
Bhaskar
 
Old 02-08-2011, 09:01 PM   #4
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Lightbulb

Hi Bhaskar,

Assuming you have installed it properly download this tar.gz file and put it in /etc folder.

First, unzip it and then untar it.

Also, do this if you have installed from source files.
Code:
groupadd puppet  
useradd -g puppet puppet 
chown -R puppet.puppet /var/lib/puppet
Then,
Code:
cp -p /etc/puppet/manifests/nodes.pp /etc/puppet/manifests/nodes.pp_orig
> /etc/puppet/manifests/nodes.pp
cat /etc/puppet/manifests/nodes.pp
class test1 {
exec { "/bin/echo hello > /tmp/vikas": }
exec { "/bin/echo vikas >> /tmp/vikas": }
}
node box1 {             ## Assuming your machine name is box1
    include "test1"
}
Finally, you can start you puppet as below

Code:
# service puppetmaster stop
# /usr/sbin/puppetmasterd --logdest console
# /usr/sbin/puppetd --server box1.test.com --verbose --waitforcert 30
# /usr/sbin/puppetca --list
box1.test.com       --- you should see your system hostname here.
/usr/sbin/puppetca --sign box1.test.com
To check if all worked well, try below command
Code:
puppetd --test --server=box1.test.com --debug
This should create a file /tmp/vikas

Try this and get back if you still face problems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
So who has installed Puppet 0.25.0? DaveQB Linux - Enterprise 4 10-02-2009 02:20 AM
install puppet on esx or red hat 3 dotan Linux - Enterprise 1 09-08-2009 01:56 PM
Puppet/facter anomalies DaveQB Linux - Software 1 08-28-2009 01:42 AM
LXer: Servers Dance on a String With Puppet LXer Syndicated Linux News 0 03-04-2007 09:16 AM
is that puppet in the wireless commercial running on embedded Linux? t3gah General 4 05-28-2005 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration