Changes between Initial Version and Version 1 of how-to/puppet/freepuppet-helper


Ignore:
Timestamp:
May 31, 2011, 10:12:17 AM (8 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • how-to/puppet/freepuppet-helper

    v1 v1  
     1[[PageOutline]]
     2= freepuppet-helper =
     3
     4freepuppet-helper is a python script for executing commands either locally or on a series of remote hosts.
     5
     6Our [wiki:puppet puppet repo] contains a helper directory with freepuppet-helper.py and freepuppet-helper.
     7
     8== Why do we need a python script if we have puppet? ==
     9
     10Puppet allows us to easily ensure that a set of commands and files are executed and copied to our servers (and will execute/copy the commands/files over and over again if necessary).
     11
     12The freepuppet-helper script allows us to execute/copy a command/file to one or more servers once and witness the output. Also, it allows us to perform operations locally, like list available servers or automate setting up a git remote for each server's puppet repository.
     13
     14== How do I install it? ==
     15
     16It's already there with the git repo. For convenience, you should take a couple extra steps:
     17
     18 * Add a symlink to your freepuppet-helper in your ~/bin directory (or another directory in your $PATH)
     19 * Add this line to your ~/.bashrc file, changing the path to the appropriate value:
     20{{{
     21export FREEPUPPET_REPO_PATH=/home/jamie/projects/mfpl/puppet/confdir
     22}}}
     23
     24== How do I use it? ==
     25
     26Run freepuppet-helper followed by one or more sub-commands.
     27
     28For example:
     29
     30{{{
     31freepuppet-helper ls
     32}}}
     33
     34Will generate a list of servers located in our manifests/nodes/production directory.
     35
     36You can limit the list by adding a colon separted argument to the command, by either specifying a specific server:
     37
     38{{{
     390 jamie@chicken:~$ freepuppet-helper ls:mandela
     40mandela
     410 jamie@chicken:~$
     42}}}
     43
     44Or, by specifying a phrase to grep all server manifests for:
     45
     46{{{
     470 jamie@chicken:~$ freepuppet-helper ls:mosh
     48albizu
     49chavez
     50daza
     51debs
     52didier
     53dorothy
     54eagle
     55ella
     56galeano
     57jones
     58julia
     59june
     60lucius
     61lucy
     62lumumba
     63malcolm
     64mandela
     65menchu
     66proudhon
     67rodolpho
     68roe
     69sojourner
     70viewsic
     710 jamie@chicken:~$
     72}}}
     73
     74ls is a local command, meaning it is executed on your computer.
     75
     76
     77== What other commands are available? ==
     78
     79Run:
     80
     81{{{
     82fab -l
     83}}}
     84
     85To see a list of all available commands (and their aliases)
     86
     87== How can I add new commands? ==
     88
     89Simply edit the freepuppet-helper.py script and commit and push your changes.