Book Image

Puppet 5 Beginner's Guide - Third Edition

By : John Arundel
Book Image

Puppet 5 Beginner's Guide - Third Edition

By: John Arundel

Overview of this book

Puppet 5 Beginner’s Guide, Third Edition gets you up and running with the very latest features of Puppet 5, including Docker containers, Hiera data, and Amazon AWS cloud orchestration. Go from beginner to confident Puppet user with a series of clear, practical examples to help you manage every aspect of your server setup. Whether you’re a developer, a system administrator, or you are simply curious about Puppet, you’ll learn Puppet skills that you can put into practice right away. With practical steps giving you the key concepts you need, this book teaches you how to install packages and config files, create users, set up scheduled jobs, provision cloud instances, build containers, and so much more. Every example in this book deals with something real and practical that you’re likely to need in your work, and you’ll see the complete Puppet code that makes it happen, along with step-by-step instructions for what to type and what output you’ll see. All the examples are available in a GitHub repo for you to download and adapt for your own server setup.
Table of Contents (21 chapters)
Puppet 5 Beginner's Guide Third Edition
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Roles and profiles


Now that we know how to include different sets of classes on a given node, depending on the job the node is supposed to do, let's think more about how to name those classes in the most helpful way. For example, consider the following list of included classes for a certain node:

classes:
- postgresql
- apache
- java
- tomcat
- my_app

The class names give some clues as to what this node might be doing. It looks like it's probably an app server running a Java app named my_app served by Tomcat behind Apache, and backed by a PostgreSQL database. That's a good start, but we can do even better than this, and we'll see how in the next section.

Roles

To make it obvious that the node is an app server, why don't we create a class called role::app_server, which exists only to encapsulate the node's included classes? That class definition might look like this (role_app_server.pp):

# Be an app server
class role::app_server {
  include postgresql
  include apache
  include java
  include...