Automating with Puppet: Initial setup
Editor's Note: This post is a taste of what you'll get in our ebook about about automating routine IT tasks with Puppet, The Top 5 Things to Automate with Puppet Right Now. Download it for free to read the rest.
As you manage more and more with Puppet, and add more contributors to the Puppet code base, you’ll want to manage scale and complexity for yourself and your team. You can do this by taking advantage of a Puppet control repository.
The control repository holds all the information needed to construct a Puppet environment. We’ve combined all the hard-won best practices for managing Puppet infrastructures into the example control repository below.
The following instructions will show you how to implement these best practices on Day One, so your Puppet Enterprise deployment can scale as rapidly as you need it to.
If you’ve already set up a control repository for your installation, you can safely skip this step.
-
Fork the Puppet example control repo into your own GitHub account.
-
Enable code manager and point the
r10k_remote
at the repository that you forked in Step 1. Remember, if you are using https to connect to Git, you don't need a private key. -
Run Puppet at the command line using
puppet agent -t
. -
Get a token from the RBAC service so we can run commands that require authentication by running
puppet-access login [username] --service-url https://<HOSTNAME OF PUPPET ENTERPRISE CONSOLE>:4433/rbac-api --lifetime 1y
. -
Synchronize your code by running
puppet code deploy production --wait
.
Deploy your code
In order to make changes to your Puppet code you will need need to do the following things:
- Make the changes locally.
- Push those changes to GitHub.
- Pull those changes down to the Puppet master.
Although you can circumvent this by editing code directly on the Puppet master, it's much easier to collaborate if you are using this process.
Once you have made changes to your Puppet code and pushed those changes to GitHub, you should do the following to get it onto the master:
-
Add and commit your changes to Git using
git add
andgit commit
. -
Push those changes to GitHub using
git push
. -
Pull the new code down onto the master using
puppet code deploy production --wait
(on the Puppet master).
If you think this is tedious, then just automate it.
Now you’re ready to start automating with Puppet! Watch this space for the rest of our series to learn about other common processes you can automate with Puppet.
Dylan Ratcliffe is a professional services engineer at Puppet.
Learn more
- Want to get all of the top 5 things to automate with Puppet right now? Go ahead, click the link to download the ebook for free.
- A collection of cloud automation presentations from PuppetConf
- 9 Ways IT Automation Makes You More Successful