-
Installing Chef Client with Test Kitchen
-
Node is a test kitchen
-
Create kitchen
-
Use the
kitchen login
command to connect to your node and install chef-client on the node
kitchen login default-ubuntu1404
curl -Lk https://www.getchef.com/chef/install.sh | sudo bash
- check Chef Client is installed on the node
chef-client --version
- Setup kitchen.
run from your workstation:
kitchen setup default-ubuntu1404
- create simple script on the node
# login to kitchen
kitchen login ..
# hello.rb
log "nothing special"
- run script on the node
# login to kitchen
kitchen login ..
# from node
chef-client -z hello.rb
Notes about test kitchen and chef-solo:
- The kitchen setup command is used to run a provisioner.
- By default, Test Kitchen is configured to use the ChefSolo provisioner, which installs Chef Client without configuring the tools to use a Chef Server.
kitchen setup
will automatically install chef-client for you
- kitchen converge performs a Chef run on your test node from your host.
kitchen converge default-ubuntu1404