Learning Puppet
eBook - ePub

Learning Puppet

Jussi Heinonen

Share book
  1. 304 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Puppet

Jussi Heinonen

Book details
Book preview
Table of contents
Citations

About This Book

Build intelligent software stacks with the Puppet configuration management suite

About This Book

  • Develop high-quality Puppet modules in an isolated development environment
  • Manage complex development environments with industry-leading configuration management tool
  • A comprehensive guide to get you started with Puppet development and deployment in virtual environments

Who This Book Is For

If you are new to configuration management and IT automation processes and are looking for better ways to manage system configuration changes at scale, this book is for you. Basic knowledge of Linux System Administration is a prerequisite.

What You Will Learn

  • Manage your system with Puppet instantly
  • Develop Puppet in an isolated development environment
  • Make your manifests reusable to avoid re-inventing the wheel
  • Automate monitoring to improve the user experience through increased uptime
  • Enable nodes to communicate with each other via Puppet Master
  • Make environment configuration dynamic using stored configurations and PuppetDB
  • Extend Puppet beyond the built-in functionalities
  • Manage your environment through the Puppet Enterprise console

In Detail

Puppet is a cross-platform, open source configuration management utility, which runs on various Unix, Linux, and Windows Microsoft platforms. It allows you to automate all your IT configurations, giving you control of what you do to each node, and also when and how you do it. You'll be able to build and manage development, test, and production environments independently without requiring previous system administration experience.

Learning Puppet is a step-by-step guide on how to get started with Puppet development and use Puppet modules as the building blocks to deploy production-ready application cluster in virtual environment.

You will begin with the installation of development environment on the VirtualBox hypervisor and Puppet Learning VM that will be used as the platform for testing and development of Puppet modules. Next, you will learn how to manage virtual machines and snapshots effectively and enhance the development experience with advanced VirtualBox features.

Later the book will focus on Puppet module development in detail. You will be guided through the process of utilizing existing modules that are available in the public module repository, write your own modules and use them to deploy a real-world web application that includes features such as monitoring and load balancing. You will then learn to scale your environment and turn your static configuration into a dynamic one through stored configurations and PuppetDB. Finally, the book will provide you with practical advice on Puppet troubleshooting and managing your environment with the wealth of features provided by the Puppet Enterprise console.

Style and approach

A comprehensive introductory guide to help you manage your infrastructure with Puppet. All instructions and explanations are supported with screenshots and code examples to ensure you get an easy start with Puppet.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning Puppet an online PDF/ePUB?
Yes, you can access Learning Puppet by Jussi Heinonen in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation en Ruby. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784399832

Learning Puppet


Table of Contents

Learning Puppet
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Puppet Development in Isolation
Puppet Manifests
Downloading Oracle VirtualBox
Downloading the Puppet Learning VM
Importing the Puppet Learning VM into VirtualBox
Virtual machine snapshots
Snapshot of the virtual machine
Puppet on command line
Puppet version
The open source Puppet
The Puppet Enterprise edition
Puppet resources
Managing resources from the command line
Puppet dry run
Use Puppet to examine the current state of resources
Puppet is run as a user root
Puppet DSL and manifests
Managing resources with the puppet apply command
Creating Puppet manifests
Idempotency
Puppet command line versus Puppet manifests
Managing files and directories with a file resource
Puppet configuration
Summary
2. Managing Packages in Puppet
Restoring a snapshot
Introducing VirtualBox Guest Additions
Shared folders
Host-only networking
Configuring shared folders
Configuring the host-only network interface
Testing shared folders
Using the file resource to configure network interface on the virtual machine
Restart networking
Creating the puppet-agent node
Take a snapshot of the virtual machine
Branch the virtual machine by creating a clone from the snapshot
Purging package resources
Summary
3. My First Puppet Module
Introducing the Puppet module
The Puppet module structure
The Puppet module name format
Generating a Puppet module
A Puppet class
Resources inside the Puppet class
Rename the module directory
Applying a Puppet class
Installing a module from Puppet Forge
Installing Apache HTTP Server
Testing the Apache HTTP Server
Customizing a web server with facts and templates
Puppet templates
Creating a template file
Creating a file resource for the template file
Facts by the facter
Facter on the command line
Accessing facts from the Puppet template
Accessing facts from Puppet manifests
A simple for loop in the Puppet template
Testing repeatable deployment
Shut down the virtual machine
Revert the machine state to the previous snapshot
Reduce memory allocation for the virtual machine
Create a linked virtual machine clone from the snapshot
Power on both the virtual machines and apply the webapp class
Summary
4. Monitoring Your Web Server
Monitoring the architecture
Creating a Nagios module for the client and server
A recap on the state of virtual machines and snapshots
Cloning the virtual machine for Nagios module development
Generating the Nagios module
Puppetize the Nagios Server installation
Configuring the Nagios Server web interface
Applying the nagios::server class
Verifying Nagios Server installation
Creating nagios::client class
Testing the nagios::client class
Enable monitoring on the web server
Configuring the web server host and checks on the Nagios Server
Creating a Nagios host
Summary
5. Load Balancing the Cluster
The parameterized class
Calling a class with parameters
Creating a parameterized class
The defined type
Calling the defined type
Creating the defined type
The load balancing architecture
Building the load balancer node
Cloning a new virtual machine for the load balancer
Reducing the virtual machine memory allocation
Creating a snapshot and starting the virtual machine
Creating a load balancer module
Installing the load balancer using class parameters
Deploying the load balancer
Verifying the load balancer deployment
Testing end-to-end functionality
Adding parameters to the loadbalancer class
Load balancing web server nodes
Enabling load balancing on the loadbalancer class
Applying and testing the load balancer
Launching the second web server node
Summary
6. Scaling Up the Puppet Environment
Puppet Master
The Puppet Master components
Certificate Authority for authorization
Mcollective for orchestration
PuppetDB for exported resources, PuppetDB queries, and reporting
Connecting Puppet Agent with Puppet Master
Creating the bootstrap module for Puppet Master and Puppet Agent
Configuring static IP address on Puppet Master
Defining resource processing order with the arrow notation
Creating class bootstrap::master
Referencing an out-of-scope variable from Puppet template
Conditional statements
The if statement
Creating site.pp file for node classification
Applying bootstrap class on Puppet Master
A first look at the Puppet Enterprise Console
Bypassing the certificate warning message
Logging on to the Puppet Enterprise Console
503 Service Temporarily Unavailable?
Creating a node group
Bootstrapping Puppet Agent
Applying the bootstrap::agent class via the bootstrap class
Signing the certificate on the Puppet Enterprise Console
Adding nodes to the node group
Deploying the Web Server node against Puppet Master
Bootstrapping Load Balancer and Nagios Server nodes
Summary
7. Making the Configuration Dynamic
An introduction to PuppetDB and exported resources
Exported resources
Exporting and importing resources
Exporting resources
Importing resources
Testing exported resources
Purgin...

Table of contents