In this blog I will try to explain about basic setup of puppet. Assuming that you are already aware about need/benefits of puppet.
Prerequisites:
- Need two servers for this activity.Will make one of the server as puppet master and the other as puppet agent.
- The other main prerequisites for installing puppet on redhat/centos is that we need to have the following.
- Ruby Language
- Ruby Libraries
- Shadow Ruby Libraries
In this example the name of two server is 'kulshresht1.home.lan' & 'kulshresht2.home.lan'
For understanding well:
kulshresht1.home.lan --> puppetmaster.example.org --> 10.50.20.19
kulshresht2.home.lan --> puppetagent.example.org --> 10.50.20.30
Map the server name as 'puppetmaster.example.org' and 'puppetagent.example.org' respectively in '/etc/hosts' file. It's better if you can get this registered in your local DNS for lookup.
Install puppet server on master server
puppet master server must contain the following packages:
- Pupppet :: contains the puppet agent
- Puppet-server :: contains the puppet master server
- facter :: contain the tool which will act as fetching information about the node
Install puppet on agent server
For testing basic setup and get puppet working , make "Agent side configuration changes" only, as stated below, and run the below command on puppet agent server. This is basic setup of puppet.
#puppet agent --no-daemonize --onetime --verbose
Now go on puppet master screen and sign the certificate using below commands
puppet cert list
puppet cert sign "puppetagent.example.org"
Few useful commands:
puppet cert clean puppetmaster.example.org
START PUPPET AGENT:
puppet agent --no-daemonize --onetime --verbose
TEST AGENT:
puppet agent --test
CREATE/GENERATE CERTIFICATE:
puppet certificate generate puppetagent.example.org --ca-location remote
HOW TO SIGN CERTIFICATE:
puppet cert list
puppet cert sign "puppetagent.example.org"
----------------------------------Agent side configuration changes-------------------------------------
Add below settings in "puppet.conf" on agent side.
server= kulshresht1.home.lan / puppetmaster.example.org
puppet.conf
[main]
# The Puppet log
directory.
# The default
value is '$vardir/log'.
logdir =
/var/log/puppet
# Where Puppet
PID files are kept.
# The default
value is '$vardir/run'.
rundir =
/var/run/puppet
# Where SSL
certificates are kept.
# The default
value is '$confdir/ssl'.
ssldir =
$vardir/ssl
server=
|
Please go through http://kulshresht-gautam.blogspot.in/2013/12/puppet-bit-advanced-setup-and.html for advance puppet setup.
No comments:
Post a Comment