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


remote-exec (3) Versions 0.1.1

remote_execute resource for Chef

cookbook 'remote-exec', '= 0.1.1'
cookbook 'remote-exec', '= 0.1.1', :supermarket
knife supermarket install remote-exec
knife supermarket download remote-exec
Quality 50%

remote-exec cookbook

This cookbook implements remote_execute resource. As its name implies, the resource executes a command on a remote server using ssh.


Tested only with Chef 12. The cookbook uses Net:SSH Ruby module, which is expected to be installed. I think, it is usually the case, if you have chef-client.


remote_execute 'i wanna do something' do
  command 'ls -l'
  address ''
  user 'root'
  password 'dontknow'


remote_execute 'name' do
  address   String          #
  command   String          # defaults to name
  returns   Integer, Array  #
  password  String          #
  user      String          #
  timeout   Integer         # default: 60

  not_if_remote   String    #
  only_if_remote  String    #

  action    Symbol          # defaults to :run


The resource has the following actions:

:nothing Prevent a command from running. Does nothing ;-)

:run Default. Run a command.


The resource has the following properties:

command The name of the command to be executed. Default value: the name of the resource block

returns 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. Default value: 0.

address The address of the remote server.

user The username used to connect to the remote server.

password The password for the user to connect to the remote server. If not specified, Net:SSH tries to connect using SSH keys, and if it doesn't help, asks for a password.

timeout Timeout for SSH session. Default is 60 seconds.


There are 2 additional guards, implemented in the resource:

not_if_remote It prevents a resource from executing, if the specified condition (command) returns on the remote server true (0).

only_if_remote It allows a resource to execute, only if the specified condition (command) returns on the remote server true (0).


remote_execute 'create a file' do
  command 'touch /tmp/tempfile'
  address ''
  user 'root'
  password 'dontknow'
  only_if_remote 'ls /dev/null'


v0.1.1 2016-11-28

  • timeout option added

v0.1.0 2016-11-07

  • Initial release

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.1 failed this metric

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

Foodcritic Metric

0.1.1 passed this metric