Tuesday, November 5, 2013

Installing Puppet to Manage VM's

This post will go over how to install a puppet server and a puppet client on a CentOS 6.4 vm running on VMWare 5.1.

Step 1:
Clone a vm.

cd /vmfs/volumes/datastore1
mkdir "CentOS 6.4 - Puppet Server"
cd CentOS\ 6.4\ -\ Puppet\ Server/
cp ../Base\ CentOS\ 6.4/Base\ CentOS\ 6.4.vmx ./CentOS\ 6.4\ -\ Puppet\ Server.vmx
vmkfstools -i "/vmfs/volumes/datastore1/Base CentOS 6.4/Base CentOS 6.4.vmdk" \
"/vmfs/volumes/datastore1/CentOS 6.4 - Puppet Server/CentOS 6.4 - Puppet Server.vmdk"
vim-cmd solo/registervm "/vmfs/volumes/524734d7-f389d00a-4f68-b870f4dd73cf/CentOS 6.4 \
- Puppet Server/CentOS 6.4 - Puppet Server.vmx"
vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.on 18


Step 2:
Install the puppet server.  Add the puppetlabs repository.

rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm

Install the application.

yum install puppet-server

Step 3:
Enable services.  Start the puppet master.

/etc/init.d/puppetmaster start

Permanently enable services.

puppet resource service puppet ensure=running enable=true
puppet resource service puppetmaster ensure=running enable=true

Modify the config file.

/etc/puppet/puppet.conf
[master]
certname = puppetmaster
autosign = false

Step 4:
Install passenger.  First, install necessary packages:

yum install httpd httpd-devel mod_ssl ruby-devel rubygems gcc make gcc-c++ \
curl libcurl-devel openssl-devel

Install passenger.  The output of the second command will display how to configure the apache vhost.

gem install rack passenger
passenger-install-apache2-module

Install the puppet master rack application

mkdir -p /usr/share/puppet/rack/puppetmasterd
mkdir /usr/share/puppet/rack/puppetmasterd/public /usr/share/puppet/rack/puppetmasterd/tmp
cp /usr/share/puppet/ext/rack/files/config.ru /usr/share/puppet/rack/puppetmasterd/
chown puppet /usr/share/puppet/rack/puppetmasterd/config.ru

Step 5:
Sign certs of new machines.  Another post will go through how to add a node to the server, but the two commands needed are:

puppet cert list
puppet cert --sign 

No comments:

Post a Comment