Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run "kitchen verify" using inspec thorugh ssh #76

Open
warp3r opened this issue Jun 3, 2016 · 2 comments
Open

Unable to run "kitchen verify" using inspec thorugh ssh #76

warp3r opened this issue Jun 3, 2016 · 2 comments

Comments

@warp3r
Copy link

warp3r commented Jun 3, 2016

Hi there,

we are running some test kitchen machines via the vsphere provider with the following configuration

platforms:
  - name: sles-11.3
    transport: 
      username: xxxx
      password: xxxx
      port: 22
      ssh_key:  ~/xxxx.pem
    driver:
      name: vsphere
      driver_options:
        host: '1.2.3.4'
        user: 'xxxx'
        password: 'xxxx'
        insecure: true
      machine_options:
          start_timeout: 600
          create_timeout: 600
          ready_timeout: 600
          bootstrap_options:
            use_linked_clone: true
            datacenter: 'PoC'
            template_folder: 'xxx/Templates'
            template_name: 'TPL_xxx'
            vm_folder: 'xxxx'
            num_cpus: 2,
            network_name: 
            - xxxx
            memory_mb: 4096
            ssh:
              user: xxx
              paranoid: false
              password: xxxx
              port: 22
            customization_spec:
              domain: local
              org_name: 'xxx'
              ipsettings:
                ip: 10.10.1.235
                subnetMask: 255.255.255.0
                gateway: 
                  - 10.10.1.1
                dnsServerList:
                  - 10.10.1.2

and it fails with:

D      Initialize InSpec
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #verify action: [Transport error, can't connect to 'ssh' backend: SSH session could n
ot be established]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

D      ------Exception-------
D      Class: Kitchen::ActionFailed
D      Message: Failed to complete #verify action: [Transport error, can't connect to 'ssh' backend: SSH session could n
ot be established]
D      ---Nested Exception---
D      Class: RuntimeError
D      Message: Transport error, can't connect to 'ssh' backend: SSH session could not be established
D      ------Backtrace-------
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/inspec-0.22.0/lib/inspec/backend.rb:44:in `rescue in create'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/inspec-0.22.0/lib/inspec/backend.rb:16:in `create'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/inspec-0.22.0/lib/inspec/runner.rb:45:in `configure_transport
'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/inspec-0.22.0/lib/inspec/runner.rb:29:in `initialize'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/kitchen-inspec-0.13.0/lib/kitchen/verifier/inspec.rb:43:in `n
ew'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/kitchen-inspec-0.13.0/lib/kitchen/verifier/inspec.rb:43:in `c
all'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:423:in `block in v
erify_action'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:513:in `call'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:513:in `synchroniz
e_or_call'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:478:in `block in a
ction'
D      C:/opscode/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:477:in `action'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:415:in `verify_act
ion'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:348:in `block in t
ransition_to'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:347:in `each'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:347:in `transition
_to'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:160:in `verify'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/command.rb:176:in `public_send
'
D      C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/command.rb:176:in `block (2 le
vels) in run_action'
D      ----------------------

we've tried several approaches when specifying the ssh credentials, but none of them seems to work.

We have another test with windows machines that work wonderfully and also the test for linux using kitchen-ec2 works fine.

Has anybody managed to get kitchen-vsphere to run an inspec test successfully?

thanks for your help!

@josh-barker
Copy link

Hi @warp3r
I haven't had any issues with using Kitchen+InSpec on Windows and Redhat.
I'm using Test Kitchen version 1.15.0 and don't have a transport section defined.

@jalberti
Copy link

See inspec/train#129 and patch inspec/train#183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants