Skip to content

Instantly share code, notes, and snippets.

@iankronquist
Last active September 21, 2015 22:56
Show Gist options
  • Save iankronquist/831c052c68bd32962779 to your computer and use it in GitHub Desktop.
Save iankronquist/831c052c68bd32962779 to your computer and use it in GitHub Desktop.
An Intro to Strings

Here is a quick intro for how to use strings for those not very familiar with puppet and the command line.

Setup

Do this once to get strings set up:

  1. Installing strings

$ puppet module install puppetlabs-strings

  1. Install the yard gem

$ gem install yard

Running Strings

Strings looks at your source code, parses it and looks at comments and then makes a website out of them. It puts the website in the doc/ directory.

  1. Find where your modules live:

$ puppet config print modulepath

It might output something like /Users/iankronquist/.puppetlabs/etc/code/modules.

Copy that path, that's where all your puppet modules live.

  1. Download a new module from the forge:

$ puppet module install puppetlabs-apache

  1. Running strings on a module

First, go where your modules are stored on the module path (the path we copied earlier)

$ cd /Users/iankronquist/.puppetlabs/etc/code/modules

Next go to the module you want to document:

$ cd apache

  1. Run strings:

$ puppet strings

  1. Now look at the documentation:

$ open doc/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment