Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Puppet 5 Beginner???s Guide

You're reading from   Puppet 5 Beginner???s Guide Go from newbie to pro with Puppet 5

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781788472906
Length 266 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John Arundel John Arundel
Author Profile Icon John Arundel
John Arundel
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting started with Puppet FREE CHAPTER 2. Creating your first manifests 3. Managing your Puppet code with Git 4. Understanding Puppet resources 5. Variables, expressions, and facts 6. Managing data with Hiera 7. Mastering modules 8. Classes, roles, and profiles 9. Managing files with templates 10. Controlling containers 11. Orchestrating cloud resources 12. Putting it all together Index

Getting ready for Puppet

Although Puppet is inherently cross-platform and works with many different operating systems, for the purposes of this book, I'm going to focus on just one operating system, namely the Ubuntu 16.04 LTS distribution of Linux, and the most recent version of Puppet, Puppet 5. However, all the examples in the book should work on any recent operating system or Puppet version with only minor changes.

You will probably find that the best way to read this book is to follow along with the examples using a Linux machine of your own. It doesn't matter whether this is a physical server, desktop or laptop, cloud instance, or a virtual machine. I'm going to use the popular Vagrant software to run a virtual machine on my own computer, and you can do the same. The public GitHub repository for this book contains a Vagrantfile, which you can use to get up and running with Puppet in just a few steps.

Installing Git and downloading the repo

To get a copy of the repo that accompanies this book, follow these steps:

  1. Browse to https://git-scm.com/downloads
  2. Download and install the right version of Git for your operating system.
  3. Run the following command:
    git clone https://github.com/bitfield/puppet-beginners-guide-3.git
    

Installing VirtualBox and Vagrant

If you already have a Linux machine or cloud server you'd like to use for working through the examples, skip this section and move on to the next chapter. If you'd like to use VirtualBox and Vagrant to run a local virtual machine (VM) on your computer to use with the examples, follow these instructions:

  1. Browse to https://www.virtualbox.org/
  2. Download and install the right version of VirtualBox for your operating system
  3. Browse to https://www.vagrantup.com/downloads.html
  4. Select the right version of Vagrant for your operating system: OS X, Windows, and so on
  5. Follow the instructions to install the software

Running your Vagrant VM

Once you have installed Vagrant, you can start the Puppet Beginner's Guide virtual machine:

  1. Run the following commands:
    cd puppet-beginners-guide-3
    scripts/start_vagrant.sh
    

    Vagrant will begin downloading the base box. Once that has booted, it will install Puppet. This may take a while, but once the installation is complete, the virtual machine will be ready to use.

  2. Connect to the VM with the following command:
    vagrant ssh
    
  3. You now have a command-line shell on the VM. Check that Puppet is installed and working by running the following command (you may get a different version number, which is fine):
    puppet --version
    5.2.0
    

    Tip

    If you're using Windows, you may need to install the PuTTY software to connect to your VM. There is some helpful advice about using Vagrant on Windows at:

    http://tech.osteel.me/posts/2015/01/25/how-to-use-vagrant-on-windows.html

Troubleshooting Vagrant

If you have any problems running the VM, look for help on the VirtualBox or Vagrant websites. In particular, if you have an older machine, you may see a message like the following:

VT-x/AMD-V hardware acceleration is not available on your system. Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.

Your computer may have a BIOS setting to enable 64-bit hardware virtualization (depending on the manufacturer, the trade name for this is either VT-x or AMD-V). Enabling this feature may fix the problem. If not, you can try the 32-bit version of the Vagrant box instead. Edit the file named Vagrantfile in the Git repository, and comment out the following line with a leading # character:

config.vm.box = "ubuntu/xenial64"

Uncomment the following line by removing the leading # character:

# config.vm.box = "ubuntu/xenial32"

Now re-run the scripts/start_vagrant.sh command.

You have been reading a chapter from
Puppet 5 Beginner???s Guide - Third Edition
Published in: Oct 2017
Publisher: Packt
ISBN-13: 9781788472906
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image