Puppet install on Ubuntu 14.04 LTS
Puppet
In this chapter, we'll install Puppet on Ubuntu 14.04 LTS "Trusty Tahr" from https://apt.puppetlabs.com/.
There are a variety of ways to install open source Puppet. We will use the debian package called puppetmaster-passenger, which is provided by Puppet Labs. The puppetmaster-passenger package includes the Puppet master plus production-ready web server (Passenger with Apache), which eliminates a few configuration steps compared to using the basic puppetmaster package.
Download the "puppetlabs-release" package:
$ cd ~ $ wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
Install the package by running:
$ sudo dpkg -i puppetlabs-release-trusty.deb
Run
$ sudo apt-get update
to get the new list of available packages.
On our puppet master node, run one of the following:
1.
$ sudo apt-get install puppetmaster-passenger
The puppetlabs recommend this one, as it will save us a step in the post-install tasks. It will install Puppet and its prerequisites, and automatically configure a production-capacity web server. In other words, this puppetmaster-passenger package includes the Puppet master plus production-ready web server (Passenger with Apache), which eliminates a few configuration steps compared to using the basic puppetmaster package.
2.
$ sudo apt-get install puppetmaster
This will install Puppet, its prerequisites, and an init script (/etc/init.d/puppetmaster) for running a test-quality puppet master server.
The Puppet master, Passenger, Apache, and other required packages are now installed. Because we are using Passenger with Apache, the Puppet master process is controlled by Apache, i.e. it runs when Apache is running.
Before continuing, stop the Puppet master by stopping the apache2 service:
$ ps -ef|grep apache2 root 5320 1 0 07:14 ? 00:00:00 /usr/sbin/apache2 -k start www-data 5341 5320 0 07:14 ? 00:00:00 /usr/sbin/apache2 -k start www-data 5342 5320 0 07:14 ? 00:00:00 /usr/sbin/apache2 -k start ubuntu 5427 1368 0 07:15 pts/0 00:00:00 grep --color=auto apache2 $ sudo service apache2 stop * Stopping web server apache2 *
Changes from version to version can occasionally cause our Puppet environment to stop working properly. For this reason, we may want to maintain a consistent Puppet version across our entire infrastructure. If we decide to upgrade to a newer version, we need to make sure that we upgrade our master before any agent nodes, as the master cannot manage agents that have a higher version number.
Let's look up the version of our Puppet installation with the following command:
$ puppet help | tail -n 1 Puppet v3.8.2
We can use apt's pin feature to lock our Puppet install to 3.8.*, which will prevent apt from upgrading Puppet to a higher major release. Create a new file called in the apt preferences directory:
$ sudo vi /etc/apt/preferences.d/00-puppet.pref
Add the following lines to lock the puppet, puppet-common, and puppetmaster-passenger packages to the 3.8.* (change this to match our installed version):
# /etc/apt/preferences.d/00-puppet.pref Package: puppet puppet-common puppetmaster-passenger Pin: version 3.8* Pin-Priority: 501
Save and exit. Now our Puppet version is now locked.
The Puppet agent must be installed on any server that the Puppet master will manage. In most cases, this includes every server in our infrastructure.
Download the "puppetlabs-release" package:
$ cd ~ $ wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
Install the package by running:
$ sudo dpkg -i puppetlabs-release-trusty.deb
Run
$ sudo apt-get update
to get the new list of available packages.
Install the Puppet agent package (puppet):
$ sudo apt-get install puppet
This will install Puppet and an init script (/etc/init.d/puppet) for running the puppet agent daemon.
The puppet agent is disabled by default. To change this, update its default file:
$ sudo vi /etc/default/puppet
And change value of START to "yes":
START=yes
Setting this to "yes" allows the puppet agent service to run while setting this to "no" keeps the puppet agent service from running.
Save and exit /etc/default/puppet.
Let's look up the version of our Puppet installation with the following command:
$ puppet help | tail -n 1 Puppet v3.8.2
As with the Puppet master, we want to use the apt pin feature to lock the version of the Puppet agent:
$ sudo vi /etc/apt/preferences.d/00-puppet.pref
Add the following lines to lock the puppet and puppet-common packages to the 3.8.* (change this to match our installed version):
# /etc/apt/preferences.d/00-puppet.pref Package: puppet puppet-common Pin: version 3.8* Pin-Priority: 501
Save and exit. Now our Puppet version is now locked.
Let's move on to the next step:
Puppet master post install tasks - master's names and certificates setup,Puppet
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization