Puppet 4: Working with Files and Templates

In this course, you will learn how to refactor your Puppet code to make use of templates, reduce the required files for a module, as well as how you can deliver parts of files, files, or complete sub-directories with Puppet.
Course info
Rating
(12)
Level
Intermediate
Updated
Sep 2, 2016
Duration
3h 7m
Table of contents
Course Overview
Puppet File and Template Tools
Using Puppet Templates
Working with ERB Templates
Working with EPP Templates
Delivering Files with Puppet
Ensure Content Using File_Line
Delivery of File Parts with Concat
Description
Course info
Rating
(12)
Level
Intermediate
Updated
Sep 2, 2016
Duration
3h 7m
Description

There are many scenarios where adding functionality to your Puppet modules can make your work easier. In this course, Puppet 4: Working with Files and Templates, you'll learn how to make use of templates in your Puppet code and how you can deliver files with Puppet. First, you'll see how easily you can reduce the number of files a module requires by making use of variable data and templates. The original template language was Ruby, but now with Puppet 4 you can support both Ruby and Puppet templates. Next, you'll look at ways to deliver files and parts of files. Finally, you'll learn how you can deliver a complete folder structure if required, purging any unmanaged content using file\-line while concat delivers single lines or fragments of files allowing for autonomous edits to the managed files. By the end of the course, you will be able to create Puppet modules delivering configurations using templates, as well as allowing autonomous edits using file fragments.

About the author
About the author

Andrew is a committed evangelist of the Linux Operating System and the concept of community and freedom that it provides. He has worked as a technical trainer since 1995 and has taught throughout the world, including Australia, the US, Germany and Eastern Europe. Andrew started teaching Linux in 2004 when Novell acquired SUSE and has been a long time supporter of Novell and provides SYSOP support the the Certifed Novell Instructor community on Linux. Andrew founded theurbanpenguin and has been submitting video training material to his YouTube channel since 2009 and currently has over 8,500 subscribers and 1.6 Million views. Andrew has had two publications with Packt: Citrix Access Gateway VPX Essentials (2012) and Citrix XenApp (2013).

More from the author
Linux: System Security (LPIC-2)
Intermediate
3h 6m
Mar 7, 2018
Linux: Email Services (LPIC-2)
Intermediate
2h 21m
Feb 20, 2018
Linux: Network Client Management (LPIC-2)
Intermediate
3h 53m
Jan 11, 2018
More courses by Andrew Mallett
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hello everyone, and welcome. My name is Andrew Mallett and you might know me as The Urban Penguin, and I certainly hope that you are ready for the third Puppet course in this series, the Puppet 4: Working with Files and Templates course. Now you know that I work in the UK, and I have my own Linux training and consultancy company, and Puppet has always been my configuration tool of choice. I started using Puppet about seven or eight years ago to be able to complete classroom setups, and I'm still using it today. In this course, we're going to learn how we can refactor our Puppet code to make great use of templates, reducing the number of required files that we need within a module. We'll also see how we can deliver parts of files, files, or even complete subdirectory structures with Puppet. We're going to continue with the NTP theme that we've looked at in our previous courses, and we're going to especially look at purging resources, using ERB and EPP templates, and we'll look at how we can use concats to deliver file fragments. By the end of this course, you should be able to create exquisite Puppet modules, delivering configurations using templates, as well as allowing for autonomous edits using file fragments. Now of course you are going to need some basic knowledge of Linux and working at the command line, and an understanding of Puppet that can be gained from the Puppet 4: Language Essentials course.

Ensure Content Using File_Line
Hello, and welcome to this Pluralsight presentation. My name is Andrew Mallett, and I'm back again to help guide you through the module, where we take a look at Ensuring Content Using File_Line. Now so far we've been concentrating on managing the complete file, whether that's via a template or via copying the file or subdirectory down through to the client system. But sometimes, you know, managing the complete file is not going to be desirable. So in this module and the next module, we'll be looking at ways that we can manage elements of the file without managing the complete configuration. So lined up for you now, we're going to be taking a look at investigating the standard library from Puppet Labs. We'll be looking at how we can utilize the file_line type to ensure file content. And we'll be building a message of the day module to implement file_line. So Puppet Labs and the standard library. Well, they call it the standard library, but let's make this clear, it's not provided as standard, so we're going to make sure that we install this without fail. We've already seen how useful and needed this is by looking at some of our validation tools that we use from the standard library. Very early on, we could use it for encrypting the user's password when we're looking at managing new users. We're now going to extend this a little bit further by looking at the type file_line. Let's move out to some of the documentation for the standard library, just to see what the standard library can provide for us.