Code Monkey home page Code Monkey logo

capistrano-knife-solo's Introduction

Capistrano-Knife-Solo

Integrates Capistrano (v3.1+) with Knife Solo to automate the preparation and provisioning of nodes via Chef Solo.

Capistrano-Knife-Solo uses the configured servers and roles from Capistrano, it feeds them directly into Knife Solo/Chef for node deployment.

This assumes that a Chef role exists to match the defined Capistrano roles (excluding :all).

Should work with other Capistrano plugins that dynamically add servers such as Cap-EC2

Note: By default Capistrano-Knife-Solo ignores any existing Chef/Knife role definitions. A role is automatically assinged to match the Capistrano roles and these are programatically inserted into each node's run list.

Limitations (PRs welcome)

  • Capistrano (SSHKit) supports multiple SSH key files. Knife Solo only accepts one identity file. Make sure that the correct key is the first configured in Cap.

  • Chef Environments are not supported.

Installation

  • gem install capistrano-knife-solo or add the gem to your project's Gemfile.

  • Add this line to your Capfile: require 'capistrano-knife-solo'

Usage

Some tasks are added to Capistrano - these are scoped by stage:

$ bundle exec cap -T
...
cap knife:bootstrap # Prepare then cook a node/role with Chef
cap knife:clean     # Clean a node/role with Chef
cap knife:cook      # Cook a node/role with Chef
cap knife:prepare   # Prepare a node/role with Chef

e.g. to run Chef on all staging servers cap staging knife:cook

All the Capistrano filtering options are supported.

If you wanted to automatically run Chef before each deploy you could add before 'deploy:starting', 'knife:cook' to your deploy.rb tasks.

Configuration

Several configuration values exist, the defaults are listed below.

set :knife_check_disable, false # Check for chef-solo before deploy:check
set :knife_args, nil # the equivalent of command line arguments to knife solo

set :knife_startup_script, nil # The startup script on the remote server containing variable definitions
set :knife_sudo_command, nil # remote sudo command, if not sudo
set :knife_host_key_verify, false # don't verify ssh key
set :knife_cookbook_path, %w{cookbooks site-cookbooks} # cookbook path relative to Capfile
set :knife_berkshelf, true # use Berkshelf to update cookbooks if present
set :knife_librarian, true # use librarian-chef to update cookbooks if present

Contributing

  1. Fork it
  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 new Pull Request

Similar

capistrano-knife-solo's People

Contributors

rjocoleman avatar parndt avatar

Watchers

Simon Tesar avatar  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.