0.0
No commit activity in last 3 years
No release in over 3 years
Manage multiple knife configuration files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0

Runtime

>= 0
 Project Readme

knife-manage

Do you manage several chef servers? Do you ever get sick of specifying a path to the knife config file every time you want to use knife? If you answered yes then this is this plugin for you.

Requirements

The Ruby in the plugin is 1.8.7 compliant and only uses a single standard lib so this should work with Chef 10.x and Chef 11.x, though I've only tested in on 11.12.x. If you find a bug please open an issue.

Installation

$: gem install knife-manage

or for the fancy kids using the chefdk:

$: chef gem install knife-manage

or if you wanna get super crazy and build from source:

$: git clone https://github.com/ryancragun/knife-manage
$: cd knife-manage
$: bundle exec rake build
$: gem install pkg/*gem

Configuration

knife-manage expects that you keep your knife configuration files in a central repository (~/.chef) with a common naming scheme. If you have multiple knife file locations don't sweat it. We've got ya covered.

The naming scheme that is expected is knife_ORGNAME.rb where ORGNAME is the unique identifier for that knife configuration file. If you use a dash in the name knife-foo.rb or nothing knifebar.rb it should still work okay.

Usage

$: knife configure file $COMMAND [OPTIONS]

list all available configuration files in the default directory

$: knife configure file list
foo
bar

show which file is currently being used

$: knife configure file show
foo

set the configuration file you want to use

$: knife configure file set bar
bar

If you want to specify a different directory to look for files use the --file-dir switch:

$: knife configure file list --file-dir ~/code/project/.chef
project
$: knife configure file set --file-dir ~/code/project/.chef project
project

knife-manage uses symlinks to point ~/.chef/knife.rb to the config file of your choice. The first time you use the utility it might complain about the file not being a symlink. Don't worry, if you use the --force switch it'll backup the file and create a symlink.

Contributing

  1. Fork it ( https://github.com/ryancragun/knife-manage/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Happy Cheffing