knife update

A small collection of knife plugins to ease the process of safely updating chef in a setup with hundreds of nodes.

Installation

gem install knife-update

Usage

knife update status

Returns the current state of installed chef-client versions.

$ knife update status
Search nodes '*:*'

Currently installed chef-client versions:
  Chef 0.9.12: 5 nodes
  Chef 0.9.16: 10 nodes
  Chef 0.9.18: 400 nodes
  Chef 10.14.4: 500 nodes
  Chef 10.24.0: 1000 nodes

knife update recipes

Displays recipes both used and not yet used on nodes with the target chef-client version.

$ knife update recipes
Search nodes '*:*'

recipes already used on Chef 10.24.0:
  apt::internal
  barn::barn-ctrl
  chef::bootstrap_client
  ...

recipes not used on Chef 10.24.0:
  hadoop::client
  hadoop::datanode

knife update run

Updates all nodes which contain only run_list items already applied on other nodes running the target chef-client version (therefore, assuming these are compatible).

$ knife update run
Search nodes '*:*'

Update 2 nodes to chef 10.24.0
node01.example.com      Successfully installed chef-10.24.0
node01.example.com      1 gem installed
node33.example.com      Successfully installed chef-10.24.0
node33.example.com      1 gem installed

Options

Lookup possible options for each command with the -h option. In addition to common knife ssh options, the two update specific options are:

  • -q, --search-query QUERY

    Filter nodes by a different search query, defaults to *:*.

  • -t, --target-version VERSION

    The desired chef-client version, defaults to Chef::VERSION of knife.

Authors

SoundCloud Inc., Tobias Schmidt