Git Product home page Git Product logo

knife-export-plugins's Introduction

A set of export plugins for Chef's knife.

Install

Just copy one or more of the files from the knife/ subdirectory of this repo to your knife plugin directory. That's either in your home or in your chef-repo:

cp knife/* ~/.chef/plugins/knife
cp knife/* <chef-repo>/.chef/plugins/knife

Usage

Running knife with no arguments should now show three new options:

knife data bag export all (options)
knife node export all (options)
knife role export all (options)

knife data bag export all

Exports all the data bags with their content in JSON format and writes them to the data_bags directory of your chef-repo.

To help keep the SCM diffs manageable, the JSON object is sorted in a reasonable, stable way. In particular:

  • some well-known data bags are recognized, and their content is sorted in a way that makes sense for humans;
  • all other hashes are sorted alphabetically;
  • arrays and plain strings are passed through unmodified

knife node export all

Exports all the nodes in JSON format and writes them to the nodes directory of your chef-repo.

To help keep the SCM diffs manageable, the JSON object is sorted in a reasonable, stable way. In particular:

  • only normal attributes are sorted (for now);
  • the log attribute (used by nuclearrooster's update handler) is removed;
  • all other hashes are sorted alphabetically;
  • arrays and plain strings are passed through unmodified

knife role export all

Exports all the roles in JSON format and writes them to the nodes directory of your chef-repo.

To help keep the SCM diffs manageable, the JSON object is sorted in a reasonable, stable way. In particular:

  • normal and override attributes are sorted;
  • all other hashes are sorted alphabetically;
  • arrays and plain strings are passed through unmodified

Author and License

You can do whatever you want with this code :)

knife-export-plugins's People

Contributors

ryanbonham-wf avatar

Watchers

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.