GithubHelp home page GithubHelp logo

msystechnologiesllc / knife-push Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chef-boneyard/knife-push

0.0 1.0 0.0 154 KB

knife commands for Chef Push Jobs

License: Apache License 2.0

Shell 10.28% Ruby 89.72%

knife-push's Introduction

Knife Push

Gem Version Build Status

Umbrella Project: Knife

Project State: Deprecated

Issues Response Time Maximum: None

Pull Request Response Time Maximum: None

The knife push plugin is used by the Chef workstation to interact with the Push API to start jobs, view job status, view job lists, and view node status.

Requirements

  • Chef 13.0 higher
  • Ruby 2.2.2 or higher

Installation:

This plugin ships built into Chef-DK. Install Chef-DK to use the plugin.

Configuration:

If push server is running on the same host as the Chef Server, then no reconfiguration is required on the Chef workstation.

Subcommands:

This plugin provides the following Knife subcommands. Specific command options can be found by invoking the subcommand with a --help flag.

job list

The job list subcommand is used to view a list of Push jobs.

Syntax $ knife job list

job start

The job start subcommand is used to start a Push job.

Syntax

knife job start (options) COMMAND [NODE, NODE, ...]

Options

This argument has the following options:

--timeout TIMEOUT

The maximum amount of time (in seconds) by which a job must complete, before it will be stopped.

-q QUORUM --quorum QUORUM

The minimum number of nodes that match the search criteria, are available, and acknowledge the job request. This can be expressed as a percentage (e.g. 50%) or as an absolute number of nodes (e.g. 145). Default value: 100%

-b --nowait

Exit immediately after starting a job instead of waiting for it to complete.

--with-env ENVIRONMENT

Accept a json blob of environment variables and use those to set the variables for the client. For example '{"test": "foo"}' will set the push client environment variable "test" to "foo". (Push 2.0 and later)

--in-dir DIR

Execute the remote command in the directory DIR. (Push 2.0 and later)

--file DATAFILE

Send the file to the client. (Push 2.0 and later)

--capture

Capture stdin and stdout for this job. (Push 2.0 and later)

Examples

For example, to search for nodes assigned the role "webapp", and where 90% of those nodes must be available, enter:

knife job start -quorum 90% 'chef-client' --search 'role:webapp'

To search for a specific set of nodes (named chico, harpo, groucho, gummo, zeppo), and where 90% of those nodes must be available, enter:

knife job start --quorum 90% 'chef-client' chico harpo groucho gummo zeppo

Use the knife job start subcommand to run a job with the following syntax:

knife job start job_name node_name

For example, to run a job named add-glasses against a node named "ricardosalazar", enter the following:

knife job start add-glasses 'ricardosalazar'

job output

The job output command is used to view the output of Push jobs. (Push 2.0 and later). The output capture flag must have been set on job start; see the --capture option.

Syntax

knife job output JOBID

Examples

knife job output 26e98ba162fa7ba6fb2793125553c7ae test --channel stdout

Options

--channel [stderr|stdout]

The output channel to capture.

job status

The job status command is used to view the status of Push jobs.

Syntax

knife job status JOBID

Examples

For example, to view the status of a job that has the identifier of "235", enter:

knife job status 235

node status

The node status argument is used to identify nodes that Push may interact with.

Syntax

knife node status

Contributing

For information on contributing to this project see https://github.com/chef/chef/blob/master/CONTRIBUTING.md

License

Author: John Keiser([email protected])

Copyright: Copyright 2008-2018, Chef Software, Inc.

License: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

knife-push's People

Contributors

chef-ci avatar chefsalim avatar jkeiser avatar jtimberman avatar jwilberding avatar markan avatar martinisoft avatar ryancragun avatar scottopherson avatar stevendanna avatar tas50 avatar tduffield avatar thommay avatar

Watchers

 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.