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

Select Status


expect (4) Versions 2.0.0

Installs/Configures expect package

cookbook 'expect', '= 2.0.0', :supermarket
cookbook 'expect', '= 2.0.0'
knife supermarket install expect
knife supermarket download expect
Quality 50%

Expect Cookbook

Chef cookbook
Build Status


This cookbook will install Expect package.

Expect is a tool for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial. Expect is also useful for testing these same applications. And by adding Tk, you can also wrap interactive applications in X11 GUIs.
Expect can make easy all sorts of tasks that are prohibitively difficult with anything else. You will find that Expect is an absolutely invaluable tool - using it, you will be able to automate tasks that you've never even thought of before - and you'll be able to do this automation quickly and easily.

Expect requires Tcl (tool command language). This cookbook will provide Tcl package if necessary (currently only Windows platform requires it).


  • Ubuntu
  • CentOS
  • RedHat
  • Fedora
  • Mac OS X
  • Windows


  • Chef 12 or later



Key Type Description Platform Default
default['expect']['include_homebrew'] Boolean Include homebrew recipe for installing brew on Mac OS Mac OS true
default['expect']['cygwin']['from_system'] Boolean Use the Cygwin from system Windows false
default['expect']['cygwin']['home'] String Installation path for the Cygwin Windows 'C:\\cygwin'
default['expect']['cygwin']['site'] String Server where the Cygwin should search for the packages Windows ''



Installs Expect package on node and if the node platform is Windows then the recipe also installs Cygwin component.

Usage - expect::default

Just include expect in your node's run_list:

  "run_list": [


This cookbook provides a script provider called expect_script which will execute expect script using Tcl according to current OS.

Property Type Description Default Required
cwd String The current working directory true false
code String A quoted string of code to be executed false true
environment Hash A Hash of environment variables in the form of ({"ENV_VARIABLE" => "VALUE"}) 'C:\\cygwin' false
user [String, Integer] The user name or user ID that should be changed before running a command nil false
group [String, Integer] The group name or group ID that must be changed before running a command nil false

Usage expect_script

expect_script 'Example expect script with system command' do
  code <<-EOH
    spawn ftp
    set timeout 30
    expect {
      -regexp "ftp.*" {
        exp_send "bye\r"
expect_script 'Example expect script with bash script' do
  cwd '/'
  environment 'PATH' => "#{ENV['PATH']}:/tmp/test"
  code <<-EOH
    set timeout 30
    expect {
      -regexp "Would you like to delete your all files (yes/no)?.*" {
        exp_send "no\r"
  user 'root'
  group 'root'


License and Authors

Authors: Radoslaw Jaros

Dependent cookbooks

windows >= 1.44.1
homebrew >= 2.1.0
cygwin ~> 0.7.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

CHANGELOG for Expect cookbook

This file is used to list changes made in each version of the Expect cookbook.


  • Add expect_script resource
  • Change expect package provider for Windows platform (Cygwin)


  • Add default recipe with installation of the Expect package for platforms: Ubuntu, Mac OS X, Windows
  • Add .travis, .rubocop and kitchen test with serverspec (provider Vagrant)

Collaborator Number Metric

2.0.0 failed this metric

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

Contributing File Metric

2.0.0 passed this metric

Foodcritic Metric

2.0.0 failed this metric

FC069: Ensure standardized license defined in metadata: expect/metadata.rb:1
FC117: Do not use kind_of in custom resource properties: expect/resources/script.rb:20
FC117: Do not use kind_of in custom resource properties: expect/resources/script.rb:21
FC117: Do not use kind_of in custom resource properties: expect/resources/script.rb:22
FC117: Do not use kind_of in custom resource properties: expect/resources/script.rb:23
FC117: Do not use kind_of in custom resource properties: expect/resources/script.rb:24
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric

2.0.0 passed this metric

Testing File Metric

2.0.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, and your repo must contain a file

Version Tag Metric

2.0.0 passed this metric