Efficiently managing code

Although writing code directly to the disk on a Puppet Master is the easiest way to get started with Puppet, it is the least efficient model for managing infrastructure changes with Puppet. Manual changes leave the users to manage the following issues individually:

  • Backup and recovery
  • Change management
  • Replication of Puppet Masters
  • Replication of Puppet environments

Without code management, backups are often performed via disk snapshots, or by simply bundling code and moving it to a separate location in case of emergencies. Manual code placement leaves the organization responsible for maintaining a cadence and process for backing up and restoring, and for change management. Without any code management, replication of code to Puppet Masters and Puppet environments is a fully manual process, which leaves all Puppet code testing and implementation to dangerous manual processes, instead of processes within a controlled environment.

Although placing code in RPMs can solve the backup and recovery issue, change management, and the replication of Puppet Masters, it struggles with Puppet environments. An RPM has to be created for each Puppet environment, and this creates a confusing set of build files that consistently place code in multiple environments. Also, RPMs do not lend themselves to short-lived environments that are used to test individual code features.

Using Code Manager or r10k to manage code drastically simplifies these problems. Code is never written directly to the disk; instead, a list of requirements is pulled from one remote repository, and all relevant code is placed on the Puppet Master. One of the primary benefits of this model is that every change in code can be versioned in Git, and each change can be explicitly referenced (by tag, branch, or commit hash) and placed on the master. All of the code is always stored remotely, and is not reliant on the Puppet Master itself for backup and recovery. Rollbacks are now as easy as changing a single file in a remote repository. Code management also allows for the scaling of multiple Puppet Masters, with both long-lived and short-lived Puppet environments.

..................Content has been hidden....................

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