Sha256: f2a246e914a147b6b3b0b1040c3b7fdb0c5e48065657e531a663d4183a6d368e

Contents?: true

Size: 1.29 KB

Versions: 105

Compression:

Stored size: 1.29 KB

Contents

knife-exec(1) -- Run user scripts using the Chef API DSL
========================================

## SYNOPSIS

__knife__ __exec__ _(options)_

  * `-E`, `--exec CODE`:
    Provide a snippet of code to evaluate on the command line

## DESCRIPTION

`knife exec` runs arbitrary ruby scripts in a context similar to that
of the chef-shell(1) DSL. See the chef-shell documentation for a
description of the commands available.

## EXAMPLES

  * Make an API call against an arbitrary endpoint:
    knife exec -E 'api.get("nodes/fluke.localdomain/cookbooks")'
    => list of cookbooks for the node _fluke.localdomain_
  * Remove the role _obsolete_ from all nodes:
    knife exec -E 'nodes.transform(:all){|n| n.run\_list.delete("role[obsolete]")}'
  * Generate the expanded run list for hosts in the `webserver` role:
    knife exec -E 'nodes.find(:roles => "webserver") {|n| n.expand!; n[:recipes]}'

## SEE ALSO

   __chef-shell(1)__

## AUTHOR

   Chef was written by Adam Jacob <adam@opscode.com> with many contributions from the community.

## DOCUMENTATION

   This manual page was written by Joshua Timberman <joshua@opscode.com>.
   Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.

## CHEF

   Knife is distributed with Chef. <http://docs.chef.io>

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
chef-13.11.3 distro/common/markdown/man1/knife-exec.mkd
chef-13.10.4 distro/common/markdown/man1/knife-exec.mkd
chef-13.10.0 distro/common/markdown/man1/knife-exec.mkd
chef-13.9.4 distro/common/markdown/man1/knife-exec.mkd
chef-12.22.5 distro/common/markdown/man1/knife-exec.mkd
chef-12.22.5-universal-mingw32 distro/common/markdown/man1/knife-exec.mkd
chef-13.9.1 distro/common/markdown/man1/knife-exec.mkd
chef-12.22.3 distro/common/markdown/man1/knife-exec.mkd
chef-12.22.3-universal-mingw32 distro/common/markdown/man1/knife-exec.mkd
chef-13.8.5 distro/common/markdown/man1/knife-exec.mkd
chef-13.8.3 distro/common/markdown/man1/knife-exec.mkd
chef-13.8.0 distro/common/markdown/man1/knife-exec.mkd
chef-13.7.16-universal-mingw32 distro/common/markdown/man1/knife-exec.mkd
chef-13.7.16 distro/common/markdown/man1/knife-exec.mkd
chef-12.21.31 distro/common/markdown/man1/knife-exec.mkd
chef-12.21.31-universal-mingw32 distro/common/markdown/man1/knife-exec.mkd
chef-13.6.4-universal-mingw32 distro/common/markdown/man1/knife-exec.mkd
chef-13.6.4 distro/common/markdown/man1/knife-exec.mkd
chef-13.6.0-universal-mingw32 distro/common/markdown/man1/knife-exec.mkd
chef-13.6.0 distro/common/markdown/man1/knife-exec.mkd