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

EC2 Windows doesn't seem to work #6

Open
stonith opened this issue Oct 30, 2014 · 5 comments
Open

EC2 Windows doesn't seem to work #6

stonith opened this issue Oct 30, 2014 · 5 comments

Comments

@stonith
Copy link
Contributor

stonith commented Oct 30, 2014

Hi @afiune,

I can't seem to get ec2 working. I've used the following .kitchen.yml:


---
driver:
  name: ec2
  aws_access_key_id: ****
  aws_secret_access_key: *******
  security_group_ids: ["sg-*****"]
  region: us-west-2
  aws_ssh_key_id: kitchen-ci
  ssh_key: /tk-windows/id_rsa-aws
  flavor_id: m3.medium
  availability_zone: us-west-2b
  require_chef_omnibus: true

provisioner:
  name: chef_zero

transport:
  name: winrm

platforms:
  - name: windows-2012R2
    driver:
      guest: :windows
      image_id: ami-21f0bc11

suites:
- name: default
  run_list:
    - 'recipe[tk-windows::default]'
  attributes:

But kitchen-ec2 seems to try to connect via SSH instead of WinRM.

> kitchen create default-windows-2012R2
-----> Starting Kitchen (v1.3.0)
-----> Creating <default-windows-2012R2>...
       EC2 instance <i-934d23df> created.
......       (server ready)
       Waiting for ec2-54-187-72-144.us-west-2.compute.amazonaws.com:22...
       Waiting for ec2-54-187-72-144.us-west-2.compute.amazonaws.com:22...
       Waiting for ec2-54-187-72-144.us-west-2.compute.amazonaws.com:22...

Your original AMI doesn't seem to be available anymore, is SSH preinstalled or is it a base image? I am using test-kitchen v1.3.0, kitchen-vagrant v0.16.0, and kitchen-ec2 v0.9.0.

@afiune
Copy link
Owner

afiune commented Nov 1, 2014

You have to use my driver kitchen-ec2 as well as my fork of test-kitchen info your Gemfile.. Are you doing this?

gem 'kitchen-ec2', git: 'https://github.com/afiune/kitchen-ec2.git', branch: 'Transport'
gem "test-kitchen", git: 'https://github.com/afiune/test-kitchen.git', branch: 'Transport'

@stonith
Copy link
Contributor Author

stonith commented Nov 1, 2014

Yes, my Gemfile does include those lines however the readme mentions kitchen-ec2 v0.9.0 which I had to choose branch WinRM in order to get. I've tried switching back to the Transport branch but no luck. If I use the .kitchen.yml.ec2 config file as is, I get:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Kitchen::Driver::Ec2<default-windows-2008R2>#config[:aws_ssh_key_id] cannot be blank
>>>>>> ----------------------

So I've been adding a key pair to the config with aws_ssh_key_id and ssh_key lines. Maybe these lines override the transport option?

@afiune
Copy link
Owner

afiune commented Nov 1, 2014

I have to change that attribute to be not required when you use the winrm transport ...! For now you have to set it :( sorry about that.. But that will not change the behavior of the transport abstraction. You should test it and let me know your findings..

@stonith
Copy link
Contributor Author

stonith commented Nov 2, 2014

Yeah, in my original post I added the ssh attributes. I've been manually adding the gems via gem install. I just tried a bundle install with the provided Gemfile and I get the same thing (after adding the ssh attributes):

$ bundle exec kitchen list
Instance                Driver  Provisioner  Transport  Last Action
default-windows-2008R2  Ec2     ChefZero     ssh        <Not Created>
default-windows-2012R2  Ec2     ChefZero     ssh        <Not Created>

@stonith
Copy link
Contributor Author

stonith commented Nov 2, 2014

Finally got it to work! I was looking for the code that references the guest: attribute and realized it was in the test-kitchen repo and not kitchen-ec2. So I changed to the WinRM branch instead of the Transport branch of kitchen-ec2 and now EC2 works. Any plans to merge the changes into the Transport branch? How about Matt Wrock's file transfer optimizations https://github.com/mwrock/test-kitchen/tree/one_session ?

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

2 participants