2

Working on evaluating Chef. Working with Test-Kitchen.

**** note -- Linux and Chef novice ****

I am utilizing CentOS 7. Installed chefdk 0.7.0. Due to some Websense limitations in my sandbox, I was simply going to stand up 2 VM's and use the kitchen-ssh driver.

So I ran kitchen-init --driver=kitchen-ssh --create-gemfile (per this link: http://misheska.com/blog/2014/09/21/survey-of-test-kitchen-providers/#physical-machine-drivers). There were no issues with this command and its output.

I ran bundle install with no issues.

I updated my .kitchen.yml file as such:

---
driver:
  name: ssh

provisioner:
  name: chef_solo

platforms:
  - name: centos7
    driver:
      hostname: 10.226.70.31
      username: xxxxxxxxxx
      password: xxxxxxxxxx

suites:
  - name: default
    run_list:
    attributes:

I ran kitchen list and got the following error:

    kitchen list
    >>>>>> ------Exception-------
    >>>>>> Class: Kitchen::ClientError
    >>>>>> Message: Could not load the 'ssh' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.
    >>>>>> ----------------------
    >>>>>> Please see .kitchen/logs/kitchen.log for more details
    >>>>>> Also try running `kitchen diagnose --all` for configuration

    cat .kitchen/logs/kitchen.log
    E, [2015-09-15T16:48:11.630689 #30421] ERROR -- Kitchen: ------Exception-------
    E, [2015-09-15T16:48:11.630833 #30421] ERROR -- Kitchen: Class: Kitchen::ClientError
    E, [2015-09-15T16:48:11.630894 #30421] ERROR -- Kitchen: Message: Could not load the 'ssh' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.
    E, [2015-09-15T16:48:11.630936 #30421] ERROR -- Kitchen: ---Nested Exception---
    E, [2015-09-15T16:48:11.630974 #30421] ERROR -- Kitchen: Class: LoadError
    E, [2015-09-15T16:48:11.631009 #30421] ERROR -- Kitchen: Message: cannot load such file -- kitchen/driver/ssh
    E, [2015-09-15T16:48:11.631045 #30421] ERROR -- Kitchen: ------Backtrace-------
    E, [2015-09-15T16:48:11.631148 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/driver.rb:50:in `rescue in for_plugin'
    E, [2015-09-15T16:48:11.631195 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/driver.rb:40:in `for_plugin'
    E, [2015-09-15T16:48:11.631233 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:226:in `new_driver'
    E, [2015-09-15T16:48:11.631299 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:239:in `new_instance'
    E, [2015-09-15T16:48:11.631340 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:135:in `block in build_instances'
    E, [2015-09-15T16:48:11.631376 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:134:in `map'
    E, [2015-09-15T16:48:11.631412 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:134:in `with_index'
    E, [2015-09-15T16:48:11.631448 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:134:in `build_instances'
    E, [2015-09-15T16:48:11.631484 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/config.rb:110:in `instances'
    E, [2015-09-15T16:48:11.631520 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:115:in `filtered_instances'
    E, [2015-09-15T16:48:11.631557 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:145:in `parse_subcommand'
    E, [2015-09-15T16:48:11.631594 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command/list.rb:32:in `call'
    E, [2015-09-15T16:48:11.631630 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/cli.rb:56:in `perform'
    E, [2015-09-15T16:48:11.631667 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/cli.rb:108:in `list'
    E, [2015-09-15T16:48:11.631703 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    E, [2015-09-15T16:48:11.631739 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    E, [2015-09-15T16:48:11.631775 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/cli.rb:308:in `invoke_task'
    E, [2015-09-15T16:48:11.631811 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    E, [2015-09-15T16:48:11.631847 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    E, [2015-09-15T16:48:11.631914 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/bin/kitchen:13:in `block in <top (required)>'
    E, [2015-09-15T16:48:11.631976 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/errors.rb:154:in `with_friendly_errors'
    E, [2015-09-15T16:48:11.632032 #30421] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/bin/kitchen:13:in `<top (required)>'
    E, [2015-09-15T16:48:11.632098 #30421] ERROR -- Kitchen: /usr/bin/kitchen:15:in `load'
    E, [2015-09-15T16:48:11.632141 #30421] ERROR -- Kitchen: /usr/bin/kitchen:15:in `<main>'
    E, [2015-09-15T16:48:11.632204 #30421] ERROR -- Kitchen: ----------------------

I ran gem list to verify the needed gems are installed

gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
bundler (1.10.6)
CFPropertyList (2.3.1)
i18n (0.7.0)
io-console (0.4.2)
json (1.7.7)
kitchen-ssh (0.0.8)
kitchen-vagrant (0.18.0)
minitar (0.5.4)
mixlib-shellout (2.2.1)
net-scp (1.2.1)
net-ssh (2.9.2)
psych (2.0.0)
rake (10.4.2)
rdoc (4.0.0)
safe_yaml (1.0.4)
test-kitchen (1.4.2)
thor (0.19.1)

I have run down about every avenue of the various files associated to this and am at a loss on why it is not able to find the 'ssh' driver.

Any assistance would be greatly appreciated

Peter Vandivier
  • 606
  • 1
  • 9
  • 31
pcguy88
  • 51
  • 4

1 Answers1

3

I have identified the issue. When I was running any of the gem <command> commands, I was not preceding them with chef in order to be leveraging the chef embedded gems that kitchen would be attempting to leverage.

So when I ran chef gem list, I identified that kitchen-ssh was not listed. Now due to the Websense/SSL issue I have to live with in my Sandbox, I had to download and install the gem from a local file:

chef gem install --local ~/kitchen-ssh-0.0.8.gem

Note I did receive these messages:

    WARNING:  You don't have /root/.chefdk/gem/ruby/2.1.0/bin in your PATH,
              gem executables will not run.
    Successfully installed kitchen-ssh-0.0.8
    WARNING:  Unable to pull data from 'https://rubygems.org/': SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
    1 gem installed

The second WARNING is related to the Websense/SSL trials so that more than likely will not occur to others.

However it seems to have installed just fine.

And I was able to now utilize the kitchen commands I was attempting and have successfully connected via SSH to my Test Kitchen box.

Hope this is beneficial to others trying this. Cheers

Peter Vandivier
  • 606
  • 1
  • 9
  • 31
pcguy88
  • 51
  • 4