Code Monkey home page Code Monkey logo

knife-attribute's Introduction

knife-attribute

Manipulate Chef attributes via Knife

Installation

Install via rubygems:

gem install knife-attribute

Or for more recent Chef or ChefDK installations:

chef gem install knife-attribute

Usage

To work with attributes of type default, normal or override, use the -t TYPE flag (the default type if unspecified is normal for nodes, and default for all other entity types).

node attribute set

Setting node attributes may be achieved as follows:

knife node attribute set foo.example.org tz 'Australia/Melbourne'

The above would set the foo.example.org node's normal attribute tz to the string Austraila/Melbourne.

You may specify either a regular string, or a JSON structure, ie:

knife node attribute set foo.example.org apache.listen_ports '["80", "443"]' -t override

The above would set the foo.example.org node's override attribute ['apache']['listen_ports'] to the array ["80", "443"].

node attribute get

Getting node attributes may be achieved as follows:

knife node attribute get foo.example.org apache.listen_ports

Use the standard -F FORMAT flag to set the output format for complex data structures.

Unlike other actions, by default the get action will return the combined (effective) value for the attribute, if an attribute type (-t TYPE) is not specified.

knife node attribute get foo.example.org apache.listen_ports -t override -F json

The above would get the foo.example.org node's override attribute ['apache']['listen_ports'] and output it as JSON.

node attribute delete

Deleting node attributes may be achieved as follows:

knife node attribute delete foo.example.org tz

The above would delete the foo.example.org node's normal attribute tz.

knife node attribute delete foo.example.org apache.listen_ports -t override

The above would delete the foo.example.org node's override attribute ['apache']['listen_ports'].

role attribute set

Valid attribute types for roles are: ['default', 'override'].

For usage, see node attribute set above.

role attribute get

Valid attribute types for roles are: ['default', 'override'].

For usage, see node attribute get above.

role attribute delete

Valid attribute types for roles are: ['default', 'override'].

For usage, see node attribute delete above.

environment attribute set

Valid attribute types for environments are: ['default', 'override'].

For usage, see node attribute set above.

environment attribute get

Valid attribute types for environments are: ['default', 'override'].

For usage, see node attribute get above.

environment attribute delete

Valid attribute types for environments are: ['default', 'override'].

For usage, see node attribute delete above.

knife-attribute's People

Contributors

pdf avatar

Watchers

James Cloos 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.