GithubHelp home page GithubHelp logo

aaronblythe / knife-block Goto Github PK

View Code? Open in Web Editor NEW

This project forked from knife-block/knife-block

0.0 2.0 0.0 78 KB

Create and use multiple knife.rb files in Chef

Home Page: http://os.greenandsecure.co.uk

License: MIT License

knife-block's Introduction

Knife Block

Green and Secure IT Limited often have a need to work with multiple chef servers at the same time, be it due to testing/development/live scenarios or purely through working for a number of clients at once.

The knife block plugin has been created to enable the use of multiple knife.rb files against multiple chef servers.

The premise is that you have a "block" in which you store all your "knives" and you can choose the one best suited to the task.

Requirements

At present, knife-block requires ruby 1.9.2 or above. This is owing to the use of "Dir.home()" to find a user's home directory.

Installation

gem install knife-block

How does it work?

Knife looks for knife.rb in ~/.chef - all this script does is create a symlink from the required configuration to knife.rb so that knife can act on the appropriate server.

Create a knife-<service_name>.rb configuration file in your ~/.chef directory for each Chef server that you wish to connect to.

Please note - this script will check to see if knife.rb exists and whether it is a symlink or not.

If knife.rb is not a symlink, the program will exit immediately and tell you what to do.

List all available servers

(This command will also tell you which server is currently selected)

knife block list

The available chef servers are:
    * local-testing [ Currently Selected ]
    * opscode-hosted-chef

Change to a new server

knife block use <server_name>

You are asking to change from local-testing to opscode-hosted-chef. Are you sure? (Y/N) y
The knife configuration has been updated to use opscode-hosted-chef

Create a new server

(Launches "knife configure" and creates $HOME/.chef/knife-.rb)

knife block new <friendlyname>

These knife plugins are supplied without any warranty or guarantees regarding suitability for purpose.

The code requires far more tests than the simple one that currently exists.

Having said all of that, it works for us!

Copyright: Green and Secure IT Limited 2012

License: Apache 2 (http://apache.org/licenses/LICENSE-2.0.html)

knife-block's People

Contributors

tkuhlman avatar j3p0uk avatar giorgian avatar

Watchers

Aaron Blythe avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.