Puppet is an open-source automated deployment tool. The following describes the installation and configuration of puppet.
1. Operating System: redhat5.3 (64-bit System)
2. System Architecture:
192.168.0.200 Server
192.168.0.201 Client
192.168.0.202 Client
3. Install ruby. (the server and client must be installed before puppet is installed)
# Rpm-Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# Yum-y install mysql * ruby-mysql ruby-devel ruby-irb ruby-rdoc ruby-ri
Install ruby 1.8.2 or later, but do not install ruby 1.87 or later. Not Supported yet.
4. Server Installation
(1) install Facter to obtain client system information (such as hostname, ip address, OS-version, and fqdn). Install Facter with source code
# Cd/usr/local/src
# Wget http://puppetlabs.com/downloads/facter/facter-latest.tgzdownload the latest stable facter
# Tar-xvzf facter-latest.tgz
# Cd facter-latest
# Ruby install. rb Installation
# Cd ../
(2) install puppet
# Wget http://puppetlabs.com/downloads/puppet/puppet-latest.tgz download the latest stable version puppet.
# Cd puppet -*
# Ruby install. rb Installation
# Mkdir/etc/puppet
# Cp conf/auth. conf/etc/puppet/
# Cp conf/namespaceauth. conf/etc/puppet/
# Cp conf/redhat/puppet. conf/etc/puppet/
# Cp conf/redhat/server. init/etc/init. d/puppetmaster
# Chmod + x/etc/init. d/puppetmaster
5. Client installation
The installation method is the same as that on the server.
# Mkdir/etc/puppet
# Cp conf/auth. conf/etc/puppet/
# Cp conf/namespaceauth. conf/etc/puppet/
# Cp conf/redhat/puppet. conf/etc/puppet/
# Cp conf/redhat/client. init/etc/init. d/puppet
# Chmod + x/etc/init. d/puppet
6. Server Configuration
(1) Modify/etc/vhosts
# Vim/etc/hosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
127.0.0.1 puppet localhost. localdomain localhost puppet
: 1 localhost6.localdomain6 localhost6
(2) modify the hostname
# Vim/etc/sysconfig/network
NETWORKING = yes
NETWORKING_IPV6 = no
HOSTNAME = master.gangpao.com
GATEWAY = 192.168.0.1
7. Configure 192.168.0.201 on the client
(1) Modify/etc/vhosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
127.0.0.1 localhost. localdomain localhost
: 1 localhost6.localdomain6 localhost6
192.168.0.200 master.gangpao.com puppet
192.168.0.202 agent02.gangpao.com agent02
(2) modify the hostname
# Vim/etc/sysconfig/network
NETWORKING = yes
NETWORKING_IPV6 = no
HOSTNAME = agent02.gangpao.com
GATEWAY = 192.168.0.1
#/Etc/init. d/network restart
8. Start the Server Service
(1) generate the config file
# Puppet -- genconfig>/etc/puppet. conf
(2) start the service
# Puppet master -- mkusers
9. The client requests Server Authentication
Run
# Puppet agent -- server master.gangpao..com -- waitforcert 60 -- test
Run
# Puppet cert -- list to view client requests
Agent02.gangpao.com
# Puppet cert -- sign agent02.gangpao.com issue a certificate
10. Start the Client Service
#/Etc/init. d/puppet start