cookbook 'expect', '= 2.0.0'
expect (4) Versions 2.0.0 Follow0
Installs/Configures expect package
cookbook 'expect', '= 2.0.0', :supermarket
knife supermarket install expect
knife supermarket download expect
Expect Cookbook
Description
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).
Platforms
- Ubuntu
- CentOS
- RedHat
- Fedora
- Mac OS X
- Windows
Chef
- Chef 12 or later
Attributes
expect::default
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 | 'http://cygwin.mirrors.pair.com' |
Recipes
expect::default
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
:
{ "name":"my_node", "run_list": [ "recipe[expect]" ] }
Resources
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" exp_continue } eof } EOH end
expect_script 'Example expect script with bash script' do cwd '/' environment 'PATH' => "#{ENV['PATH']}:/tmp/test" code <<-EOH spawn test.sh set timeout 30 expect { -regexp "Would you like to delete your all files (yes/no)?.*" { exp_send "no\r" exp_continue } eof } EOH user 'root' group 'root' end
Contributing
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.
2.0.0
- Add expect_script resource
- Change expect package provider for Windows platform (Cygwin)
1.0.0
- 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 passed this metric
2.0.0 failed this 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 passed this metric
2.0.0 failed this metric
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
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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 passed this metric
2.0.0 failed this metric
2.0.0 passed this metric