Reader small image

You're reading from  Puppet 8 for DevOps Engineers

Product typeBook
Published inJun 2023
PublisherPackt
ISBN-139781803231709
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
David Sandilands
David Sandilands
author image
David Sandilands

David Sandilands is a principal solutions architect at Puppet, with a focus on the product management of Puppet's development ecosystem and integrations. This includes management of the Forge, supported modules, the Puppet Developer Kit, and integrations such as ServiceNow and Splunk. Before this, David worked within Puppet's solutions architect team, helping Puppet's largest customers deliver infrastructure automation at scale, and supported these customers in their DevOps working practices. He spent eight years at NatWest as a cloud infrastructure engineer delivering their IaaS platform. Based in Falkirk, Scotland, David has a Bachelor of Engineering in computer science from the University of Edinburgh.
Read more about David Sandilands

Right arrow

Classes and defined types

As discussed in Chapter 1, Puppet code is stored in manifest files ending with .pp . It is possible to just write resources into a single manifest file and then, using the apply command, puppet apply example.pp, enforce the code locally. It can also be done without the manifest file using the execute flag with the Puppet code in the field of the command, such as puppet apply -e 'Package { 'vscode': }'.

Note

puppet apply can also be run against a directory of manifests and it will parse every file in order, descending a directory structure. In Chapter 11, node definitions will allow us to utilize this.

While both of these approaches are useful for testing and learning purposes, they have a clear limitation in terms of lacking any structure, which will result in both having to run a lot of large static commands or files and having no way to pass data. Classes are named sections of code that provide this structure, offering a way...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Puppet 8 for DevOps Engineers
Published in: Jun 2023Publisher: PacktISBN-13: 9781803231709

Author (1)

author image
David Sandilands

David Sandilands is a principal solutions architect at Puppet, with a focus on the product management of Puppet's development ecosystem and integrations. This includes management of the Forge, supported modules, the Puppet Developer Kit, and integrations such as ServiceNow and Splunk. Before this, David worked within Puppet's solutions architect team, helping Puppet's largest customers deliver infrastructure automation at scale, and supported these customers in their DevOps working practices. He spent eight years at NatWest as a cloud infrastructure engineer delivering their IaaS platform. Based in Falkirk, Scotland, David has a Bachelor of Engineering in computer science from the University of Edinburgh.
Read more about David Sandilands