Title Page Copyright and Credits Mastering Puppet 5 Dedication Packt Upsell Why subscribe? packt.com Contributors About the authors About the reviewer Packt is searching for authors like you Preface Who this book is for What this book covers To get the most out of this book Download the example code files Download the color images Conventions used Get in touch Reviews Authoring Modules Using a decent IDE and plugins Vim TextMate Atom Visual Studio Using good module and class structure Following the class-naming conventions Having a single point of entry to the module Using high cohesion and loose coupling principles Using the encapsulation principle Providing sensible, well-thought-out parameter defaults Strongly typing your module variables Using the new Puppet Development Kit commands Validating your module Unit testing your module Staying on the lookout for code smells Working with dead code Using Puppet Forge Working with the community Writing great documentation Grabbing yourself a Markdown editor Vim TextMate Atom Visual Studio Standalone Markdown editors Remarkable MacDown Adding module dependencies Adding compatibility data for your modules Operating systems support Puppet and PE version support Using the new Hiera 5 module level data Summary Roles and Profiles Summary of the pattern Profiles Profiles best practices summary Designing for use of the include keyword Using subdirectories for sensible, readable profile class groups Hiding complexity with parameters, defaults, and abstraction Deciding how to set the parameters for component classes Deciding to use either automatic class parameter lookup or the lookup function Roles Roles best practices summary Constructing roles only with the include keyword Naming roles in your business's conversational name Deciding on the granularity of roles for your nodes Summary Extending Puppet Custom facts Debugging facts Custom functions Types and providers Types Creating and distributing the type Adding the namevar special attribute Adding additional type properties Adding the optional ensure property Adding type parameters Setting property and parameter defaults Checking the input value with a validate block Checking the input value against a newvalues array Checking datatype compatibility with munge Using autorequire for implicit relationships Using arrays to assign a list of values to an attribute Using the desc method to add inline documentation Providers Creating and distributing the provider Indicating the suitability of the provider to the type Using the confine method Using the defaultfor method Using the commands method Implementing the ensure property Using the exists? method Using the create and destroy methods Using the GET and SET methods to manage type properties Implementing the self.instances method Summary Hiera 5 Separation of concerns between code and data Introducing a frame for the environment A more complete hierarchy Hiera 5 summary Global, environment, and module layers Encrypted YAML backend Installing hiera-eyaml Creating the encryption keys Securely storing away the encryption keys Changing hiera.yaml Lookup function The lookup function syntax Lookup function arguments Lookup function examples Lookup strategies Deep merge lookup settings explained knockout_prefix setting sort_merge_arrays setting merge_hash_arrays setting unpack_arrays setting Debugging Hiera Old debugging techniques Equivalent debugging technique Beyond Hiera using Jerakia Jerakia advanced use cases Installing Jerakia Configuring Jerakia Creating your default Jerakia policy Using Vault as an encryption backend Installing and configuring Vault Unsealing Vault Enabling the transit backend Creating an encryption key Creating a policy for encrypting and decrypting Checking the encryption is working correctly Allowing Jerakia to authenticate with our Vault Configuring Jerakia for encryption Encryption-enabling our Jerakia lookups Summary Managing Code Efficiently managing code Code Manager Git r10k Control repository production-like environments non-production-like environments Puppetfile hiera.yaml site.pp environment.conf Roles and profiles Control repository example Installing and using r10k Code Manager Enabling Code Manager Code Manager RBAC PE client tools Multitenant control repository Summary Workflow Puppet workflow Ease of use Rapid feedback Ease of onboarding Quality control Designing a Puppet workflow Components of the Puppet workflow Repositories Control repository Module repository Tasks Clone and edit the component repositories Cloning the control repository Editing the control repository Deploying the new environment on the Puppet Master Testing the changes Merging branches Git tags and versioning Using the PDK PDK Creating new Puppet artifacts The pdk new command The pdk validate command The pdk test unit command Summary Continuous Integration Continuous Integration systems Puppet Pipelines Jenkins Managing Jenkins with Puppet rtyler/jenkins Managing our plugins Creating our first build Building our profile module Building our Jenkinsfile Connecting Jenkins to our repository Integrating the PDK Unit testing with Puppet RSpec Relevant RSpec files .fixtures.yml jenkins_spec.rb Extending our Jenkinsfile Extending our test Acceptance testing with Test Kitchen Beaker Test Kitchen and kitchen-puppet Preparing Test Kitchen on our Jenkins node Jenkins Profile .kitchen.yml Puppetfile Jenkinsfile acceptance.sh Test Performing the test Summary Extending Puppet with Tasks and Discovery Puppet Tasks Bolt Installing Bolt Managing nodes Ad hoc commands Bolt tasks task.json Task Bolt plans Puppet Enterprise Task Management Puppet Discovery Installing Discovery Preparing Puppet Discovery Managing sources Adding sources by IP address Managing credentials SSH key file Discovering Viewing the Discovery Discovering hosts Discovering packages Acting Installing agents Managing services Uses for Discovery Summary Exported Resources Virtual and exported resources Virtual resources Tags Exported resources Use cases Hosts file Load balancing Database connections Concat, file lines, and you! Concat – the hammer file_line – the scalpel Summary Application Orchestration Application definition Application components Service resources Modeling applications Application and database Dependencies Build Node declaration Application declaration DB service resource Application components Deploy Adding a load balancer and providing horizontal scaling Dependencies Build Deploy Summary Scaling Puppet Inspection Puppetserver PuppetDB dashboard Tuning Puppetserver tuning Puppet Enterprise implementation Open source implementation PuppetDB tuning Deactivating and purging nodes Managing the heap size Tuning CPU threads Automatically determining settings Puppet Enterprise PuppetDB – PostgreSQL with PGTune Horizontal scaling Puppetserver Estimating the number of agents a Puppetserver supports Adding new compile masters Load balancing Simple setup – direct connection Load balancing Certificate authority PuppetDB Summary Troubleshooting and Profiling Common component errors Puppet agents and Puppetserver Waiting on certificate signing Certificate reuse Wrong Puppet user Network connectivity DNS alt name Date and time PE console service is down Catalog errors Syntax errors Duplicate resource declaration Missing resources Autoload format Circular dependencies Debug mode – catalog Logging The logback.xml file Main configuration Appender Loggers Root logger Puppet agent PuppetDB Puppetserver Puppet Enterprise console Summary Other Books You May Enjoy Leave a review - let other readers know what you think