Learning Puppet
Hi! Recently I was reviewing two courses about Jenkins, so I had to use Vagrant for configure my environment, also I used other tools as Puppet.
In the developer day is very common configure linux servers for a lot of things: install a Jenkins, prepare the deploy environments, etc… Well, Puppet can help us to configure this servers, as a improve script shell. In this post I’m going to talk about the first steps for use Puppet.
I recommend start to learning using Vagrant for create virtual machines ( By default Vagrant machines have installed an old Puppet version), you can know more in the Making Devs Blog: Creating virtual machines with Vagrant · Blog de Making Devs
Benefits of use Puppet for configure servers
- Keeping the configuration synchronized
- Repeating changes across many servers
- Self-updating documentation
- Version Control
Puppet is a great tool for make this, instead of use manual configuration, shell scripts (fragile, hard to maintain, very specific), or use container as Docker (require more configuration management).
Puppet is more! Puppet is a language and an engine for applies configuration and managements.
Installing Puppet
The most easy way for install puppet is download the TAR version here and run the ruby script.
For install Puppet 5.5.0 in ubuntu:
Starting With Puppet
Puppet can manage three basic resource types:
- Package: for install software.
- File: for deploy configuration files.
- Service: for runs software itself.
I’m going to create my hello world example. For this I created the follow script:
hello-world.pp
For run this in the empty server:
sudo puppet apply hello-world.pp
The term File is a puppet declaration, ensure is for specify the resource type, and content is an attribute for set the content in the file.
Install Packages
We can create a puppet script for install packages, it’s very easy:
package.pp
Running Services
We can start services too:
puppet3.pp
Resources for learn more:
- Infrastructure as Code (IAC) Cookbook | PACKT Books
- Puppet 5 Beginner’s Guide - Third Edition | PACKT Books
Thanks for reading!
This are the basic uses with this tool. I hope write more about this.