Puppet: Getting Started On Windows

Now that we’ve a little about. Let’s see how easy it is to get started.

Install Puppet

PuppetLet’s get Puppet Installed. There are two ways to do that:

  1. With Chocolatey: Open an administrative/elevated command shell and type:

choco install puppet

  1. Download and install Puppet manually -

Run Puppet

  • Let’s make pasting into a console window work with Control + V (like it should):

choco install wincommandpaste

  • If you have a cmd.exe command shell open, (and chocolatey installed) type:

RefreshEnv

  • The previous command will refresh your environment variables, ala Chocolatey v0.9.8.24+. If you were running PowerShell, there isn’t yet a refreshenv for you (one is coming though!).
  • If you have to restart your CLI (command line interface) session or you installed Puppet manually open an administrative/elevated command shell and type:

puppet resource user

  • Output should look similar to a few of these:

user { 'Administrator': ensure => 'present', comment => 'Built-in account for administering the computer/domain', groups => ['Administrators'], uid => 'S-1-5-21-some-numbers-yo-500', }

  • Let's create a user:

puppet apply -e "user {'bobbytables_123': ensure => present, groups => ['Users'], }"

  • Relevant output should look like:

Notice: /Stage[main]/Main/User[bobbytables_123]/ensure: created

  • Run the 'puppet resource user' command again. Note the user we created is there!
  • Let’s clean up after ourselves and remove that user we just created:

puppet apply -e "user {'bobbytables_123': ensure => absent, }"

  • Relevant output should look like:

Notice: /Stage[main]/Main/User[bobbytables_123]/ensure: removed

  • Run the 'puppet resource user' command one last time. Note we just removed a user!

##!(http://38.media.tumblr.com/tumblr_mdzw2gCvCg1ri5gz2o1_500.gif)

Conclusion

You just did some configuration management /system administration. Welcome to the new world of awesome! is super easy to get started with. This is a taste so you can start seeing the power of automation and where you can go with it. We haven’t talked about resources, manifests (scripts), best practices and all of that yet.

Next we are going to start to get into more extensive things with Puppet. Next time we’ll walk through getting a Vagrant environment up and running. That way we can do some crazier stuff and when we are done, we can just clean it up quickly.

This article is part of the GWB Archives. Original Author: Robz / Fervent Coder

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.