Butcher

Build status

Butcher is a set of command line tools intended to ease the use of Chef with a managed Opscode account.

Installation

    gem install "butcher"

Or stick this in your Gemfile

   gem "butcher"
   #  or
   gem "butcher", "~>0.0.1"

Commands

The following commands are currently available. All commands should be run from the top level of a chef directory.

Stab

SSH into a node based on a grep of the node name.

    Usage: stab [options] node_name
      -c, --cache-dir DIR    # saves node list here (default: ~/.butcher/cache)
      -f, --force            # download new node list even if a cache file exists
      -h, --help             # prints usage
      -l, --login LOGIN      # ssh with specified username
      -v, --verbose          # be expressive

Node name is loosely matched against name attributes given to nodes in chef. If multiple nodes match a given string, a Butcher::AmbiguousNode error is thrown and the program exits.

    > knife status
    1 hours ago, app.node, app.domain.com, 1.1.1.1, solaris2 5.11.
    5 minutes ago, other.node, other.domain.com, 1.1.1.2, solaris2 5.11.

    > stab something
    Unable to find node "something"

    > stab node
    Multiple nodes match "node"
    ["app.node", "app.domain.com"] => 1.1.1.1
    ["other.node", "other.domain.com"] => 1.1.1.2

Nodes are cached in a file named after your organization in Opscode. Stab discovers this by looking at the chef_server_url in your knife.rb. For this reason, stab can only be run from the top level of a chef repo.

License

Copyright (c) 2012 Eric Saxby

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.