Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

console (1) Versions 0.1.0

lwrp for interacting with console

Berkshelf/Librarian
Policyfile
Knife
cookbook 'console', '~> 0.1.0'
cookbook 'console', '~> 0.1.0', :supermarket
knife cookbook site install console
knife cookbook site download console
README
Dependencies
Quality 33%

Console Chef LWRP

Description

Resource for console automation interaction built on greenletters, https://github.com/avdi/greenletters

Usage

The console resource is used to execute a command which expects user interaction. This resource is modelled on the chef builtin execute resource and is not similarly not idempotent. Use the <code>not_if</code> and <code>only_if</code> meta parameters to guard the use of this resource for idempotence.

Actions

<table> <thead> <tr> <th>Action</th> <th>Description</th> <th>Default</th> </tr> </thead> <tbody> <tr> <td>run</td> <td>Default. Indicates that the command should be run.</td> <td>Yes</td> </tr> </tbody> </table>

Attributes

<table> <thead> <tr><th>Attribute</th> <th>Description</th> <th>Default Value</th></tr> </thead> <tbody> <tr><td>command</td><td>The name of the command to be executed.</td><td>Default value: the name of the resource block.</td></tr></td></tr> <tr><td>creates</td><td>Indicates that a command to create a file will not be run when that file already exists.</td><td> Default value: <code>nil</code></td></tr> <tr><td>cwd</td><td>The current working directory from which a command is run.</td><td> Default value: <code>nil</code></td></tr> <tr><td>environment</td><td>A hash of environment variables in the form of {"VARIABLE" => "VALUE"}.</td><td> Default value: <code>nil</code></td></tr> <tr><td>interrupts</td><td>A hash of questions/answers in the form of { regex => "answer" } that can be triggered at anytime.</td><td> Default value: <code>nil</code></td></tr> <tr><td>answers</td><td>A hash of questions/answers in the form of { regex => "answer" } that are triggered in sequence.</td></tr> <tr><td>timeout</td><td>The amount of time (in seconds) a command will wait before timing out.</td><td> Default value: <code>300</code></td></tr> <tr><td>returns</td><td>The return value for a command. This may be an array of accepted values. An exception is raised when the return value(s) do not match.</td><td> Default value: <code>0</code></td></tr> <tr><td>provider</td><td>Optional. Use to specify a provider by using its long name. For example: provider Chef::Provider::Long::Name. See the Providers section below for the list of providers available to this resource.</td></tr> <tr><td>user</td><td>The user name or user ID that should be changed before running a command.</td><td> Default value: <code>nil</code></td></tr> </tbody> </table>

Examples

console "/usr/bin/adventure" do
  interrupts(
    /welcome to adventure/i => "no\n"
  )
  answers(
    /you are standing at the end of a road/i => "east\n",
    /inside a building/i => "quit\n",
    /really want to quit/i => "yes\n"
  )
end

Note: this example is included in the example.rb recipe.

License and Author

Author:: Luke Bradbury @hanskreuger

Copyright 2013, University of Derby

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.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.1.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.1.0 failed this metric

FC059: LWRP provider does not declare use_inline_resources: console/providers/default.rb:1
Run with Foodcritic Version 12.2.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.1.0 passed this metric

No Binaries Metric
            

0.1.0 passed this metric

Publish Metric
            

0.1.0 passed this metric

Supported Platforms Metric
            

0.1.0 failed this metric

console should declare what platform(s) it supports.

Testing File Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number