Managing Code

Code management has gone a lot of changes over the lifetime of Puppet. In earlier versions of Puppet, code management was largely left to individual users. Most users started by simply editing code directly on the Puppet Master. One organization that I worked for created Yum RPMs for every module, allowing us to roll back and forth between individual modules on multiple Puppet Masters, prior to the introduction of Puppet environments. Many users stored their Puppet code in Git or subversion and checked the code out to directories in the Puppet Master.

Each of these models comes with significant overhead management, and two solutions have risen to the top of the Puppet community during the transition from Puppet 2 to Puppet 3: Puppet Librarian and r10k. Puppet Librarian manages code like a Ruby bundle file, bringing in all the listed modules and dependencies with a single command. Automatic dependency management from the Forge has some issues, as well. Some modules include dependency lists for all operating systems, including ones that are not in your infrastructure. Some modules do not receive updates for a period of time, linking to old versions of a dependency while your organization is using a newer version. Finally, dependencies in Puppet modules are often listed as a range of versions rather than a single version, and if these modules are used across multiple manifests, it can be difficult to resolve conflicts.

Some users of Puppet Librarian use puppet-librarian-simple, which does not manage dependencies. Although puppet-librarian-simple is easier to install than r10k, it does not maintain feature parity with r10k; r10k has become the most commonly used code management solution, for both enterprise and open source users. r10k allows users to point to a remote repository that contains a set of instructions to build a Puppet environment. Puppet Enterprise comes with an expansion to r10k, known as Puppet Code Manager.

This chapter will cover the following topics:

  • Efficiently managing code
  • Code Manager
  • Git
  • r10k
  • Control repository
  • Installing and using r10k
  • Multitenant control repository
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.66.13