In this LAB, I have 2 servers hosted in my own laptop’s VirtualBox :
- puppet-master.summernguyen.net : 192.168.56.101
- puppet-agent.summernguyen.net : 192.168.56.102
OS: CentOS 6.6 x64
But in real life, I place puppet-master on my own laptop (using Ubuntu) and puppet-agent on VirtualBox. It’s very easy for me to code on my machine and test by appling to the testing server.
Step 1 : Set Hostname of the servers
It’s an easy task, everyone can do it :)
Make sure puppet-agent can ping puppet-master.summernguyen.net by hostname. You can do it using /etc/hosts file or your own DNS Server.
Step 2 : Enable the Puppet Labs Package Repository on both nodes
The newest versions of Puppet can be installed from the yum.puppetlabs.com package repository.
Enterprise Linux 7
Enterprise Linux 6
Enterprise Linux 5
Step 3 : install the puppet master on puppet-master.summernguyen.net (you will do this task only once )
Run the command :
It will install puppet master and all it’s dependencies .
Configuring the Master with config file /etc/puppet/puppet.conf
Start & enable the puppet master service
Note: The puppet master must has more than 2199MB of RAM or you will get the message: Exception in thread “main” java.lang.Error: Not enough RAM. Puppet Server requires at least 2199MB of RAM.
If you are in testing environment and your server doesn’t have enough RAM, start it in no-daemonize mode
In Production Server, please follow the instruction to Install Puppet master for production environment.
In the first time running puppet master, the master will generate itself a certificate .
Puppet Master will be started on Port TCP 8140. Please ensure that this server is reachable by this port.
Step 4 : install the puppet agent on puppet-agent.summernguyen.net (you will do this task anytime you have a new server )
Run the command :
It will install puppet agent and all it’s dependencies .
Configuring the Agent with config file /etc/puppet/puppet.conf
There are two modes when running Puppet agent :
- Daemon : it will periodically fetch configuration from Puppet Master if we start the puppet agent service service puppet start
- Command : It will fetch configuration from Puppet Master whenever we run command puppet agent -t
Like Puppet master, at the first time running, Puppet agent will generate a SSL certificate as it’s identifier.
If Puppet master enable autosign , the puppet master will accept the agent’s certificate.
If Puppet master disable autosign, we have to manual accept the agent’s certificate by issue the command on Puppet Master:
That’s how to setup for Puppet Agent to connect to Puppet Master .
Previous Topic :PUPPET AUTOMATION SERIES - PART 2 - ARCHITECTURE
Next Topic : PUPPET AUTOMATION SERIES - PART 4 - BEGINNERS CONFIGURATION GUIDE