Ask Your Question
0

Hi, Im new to puppet. Plz help me to configure the puppet config file

asked 2015-07-26 06:00:59 -0500

Sathish_Asokan gravatar image

Hi all,

I have configured the Puppet masterserver(testbox.com) puppet.conf like below:

[main] logdir = /var/log/puppet

rundir = /var/run/puppet

ssldir = $vardir/ssl

server = testbox certname = testbox dnsaltnames = testbox,testbox.com

[agent] classfile = $vardir/classes.txt

localconfig = $vardir/localconfig

[master] sslclientheader = SSLCLIENTSDN sslclientverifyheader = SSLCLIENTVERIFY

And my client server(client.com) like below:

[main] logdir = /var/log/puppet

rundir = /var/run/puppet

ssldir = $vardir/ssl

[agent] classfile = $vardir/classes.txt

localconfig = $vardir/localconfig

server = testbox.com

I have executed puppet agent --test --verbose --no-daemonize from client side and it gets executed successfully and i can see the changes also in the client side but when I tired to executed puppet apply site.pp, it shows successfully result but no changes happened at client side. Plz suggest me how execute puppet apply from master successfully.

[root@testbox ~]# puppet apply /etc/puppet/manifests/site.pp Notice: Compiled catalog for testbox in environment production in 0.17 seconds Notice: Finished catalog run in 0.08 seconds [root@testbox ~]#

My site.pp manifest:

node default {} node 'client.com'{ file {"/etc/motd": content => "Puppet demo servers\n", } }

I greatly appreciate for the solutions, Many thanks, Sathish.A

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-27 23:00:22 -0500

GregLarkin gravatar image

Puppet apply only takes effect on the machine that you run it on. If you run puppet apply on the master, your resources will be applied to the master only.

Also, puppet apply does not process the "node" directive, so your file resource would not be applied, even if your code was housed on the testbox node.

What exactly are you trying to achieve, and can you just run puppet in agent/master mode? Puppet apply is useful for testing as you're building your manifests.

edit flag offensive delete link more
0

answered 2015-07-29 08:45:46 -0500

Sathish_Asokan gravatar image

Hi Greg,

Thanks you for your prompt response!

Just take an example. Suppose I want to start crond service on hundreds of client servers. How can I achieve it from master node? I just want to apply manifest from master node to start crond service on hundreds of agent servers. Can you please briefly explain me that. May be i'm asking stupid question becoz i'm newbie to puppet.

Also please suggest me any books or URLs that would be greatly helpful for me to learn puppet in depth. Still I'm stuck with Puppet.conf part only.

I greatly appreciate for your response!!

Many Thanks, Sathish

edit flag offensive delete link more

Comments

In a nutshell, you create a Puppet manifest on your master server that includes a "cron" resource. Then you can modify your site.pp file so the default node (or a set of named nodes) includes your new class. When the Puppet agent on your client machines checks in, the service will start on each.

GregLarkin gravatar imageGregLarkin ( 2015-07-29 11:09:58 -0500 )edit

I would suggest heading over to https://learn.puppetlabs.com/ and downloading the Learning VM. It will guide you through some basic concepts and exercises so you can start to learn Puppet. You may also want to pick up a copy of "Pro Puppet", although it may be a little outdated now.

GregLarkin gravatar imageGregLarkin ( 2015-07-29 11:12:37 -0500 )edit

Thanks a lot for your great guidance Greg.

Sathish_Asokan gravatar imageSathish_Asokan ( 2015-07-30 04:25:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-07-26 06:00:59 -0500

Seen: 133 times

Last updated: Jul 29 '15