Puppet 101: Installing the agent

Carlos Gómez
devops and cross platform development
3 min readFeb 7, 2018

--

Basically, the aim of these series of articles about Puppet is to help me in the creation of a repository with code to provision my development environment and also for learning the insides and outsides of Puppet. Anyone who wants to use it is more than welcome to do it.

This will be a practical article so if you want to read the theory related to the tool you can go to the Puppet documentation. This tool will allow us to provision software automatically, but it is worth mentioning that we have two possible configurations, either in a client/server architecture, using the Puppet agent and Puppet master applications, or in a stand-alone architecture, using the Puppet apply application. For this article we will be using the stand-alone architecture.

Development environment:

Recommendations:

  • ruby version manager RVM
  • ruby version 2.3.3
  1. Install Puppet agent
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
sudo dpkg -i puppetlabs-release-pc1-xenial.deb
sudo apt-get update
sudo apt-get install puppet
sudo puppet resource group puppet ensure=present # puppet group
sudo puppet resource user puppet ensure=present gid=puppet # puppet user

2. Lets check the Puppet CLI

3. Now lets create a new file named “/tmp/example-ip”, for this purpose we need to create a new Puppet file named site.pp, this file will contain the resource file definition.

4. Finally lets apply this configuration with puppet apply

puppet apply site.pp

The file was successfully created:

Code: https://github.com/devcfgc/puppet101/tree/production/standalone
Vagrant box for testing: https://github.com/devcfgc/puppet101/blob/production/standalone/Vagrantfile

Note: For getting the latest puppet agent version you need to install it as:

sudo apt-get install puppet-agent

--

--

Cloud/Software Architect and DevOps learning about #devops, #cloud, #netcore, #microservices and #newtech