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

Creating windows-guest-support branch for kitchen-ec2 #96

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.9.2 / 2015-01-27
### New features
* Adding support for AWS Private Key Pair from TeamCity through AWS_PRIVATE_KEY Environment variable

## 0.9.1 / 2015-01-20
### New features
* Supports Amazon generated Windows Password
* Improved WinRm provisioning through user_data


## 0.8.0 / 2014-02-11

### Bug fixes
Expand Down
46 changes: 38 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
A [Test Kitchen][kitchenci] Driver for Amazon EC2.

This driver uses the [fog gem][fog_gem] to provision and destroy EC2
instances. Use Amazon's cloud for your infrastructure testing!
instances. Use Amazon's cloud for your Linux and Windows infrastructure testing!

## <a name="requirements"></a> Requirements

Expand All @@ -21,7 +21,9 @@ Please read the [Driver usage][driver_usage] page for more details.
## <a name="default-config"></a> Default Configuration

This driver can determine AMI and username login for a select number of
platforms in each region. Currently, the following platform names are
platforms in each region.

For Windows instances the generated Administrator password is fetched automatically from Amazon EC2 with the same private key as we use for SSH logins to Linux. Currently, the following platform names are
supported:

```ruby
Expand All @@ -35,6 +37,9 @@ platforms:
- name: ubuntu-14.04
- name: centos-6.4
- name: debian-7.1.0
- name: windows-2008r2
- name: windows-2012r2

```

This will effectively generate a configuration similar to:
Expand Down Expand Up @@ -173,6 +178,7 @@ The place from which to derive the hostname for communicating with the instance.

The default is unset.


### <a name="config-region"></a> region

**Required** The AWS [region][region_docs] to use.
Expand Down Expand Up @@ -211,11 +217,18 @@ The default is `{ "created-by" => "test-kitchen" }`.

### <a name="config-username"></a> username

The SSH username that will be used to communicate with the instance.
The SSH or WinRM username that will be used to communicate with the instance.

The default will be determined by the Platform name, if a default exists (see [amis.json][amis_json]). If a default cannot be computed, then the default is `"root"`.

The default will be determined by the Platform name, if a default exists (see
[amis.json][amis_json]). If a default cannot be computed, then the default is
`"root"`.
For Windows AMIs if the username is configured other then Administrator,
kitchen-ec2 will create that user during the server creation with the specified
static password.

### <a name="config-password"></a> password

WinRM static password to be used for connecting to a Windows AMI with the
configured static `username` other than Administrator.

### <a name="config-user_data"></a> user_data

Expand Down Expand Up @@ -262,6 +275,16 @@ driver:
ebs_volume_size: 6,
ebs_delete_on_termination: 'true'
ebs_device_name: '/dev/sda'
tags:
Name: 'test-kitchen instance'
Environment: 'dev'

provisioner:
name: chef_solo

# Default transport is SSH, which should be overridden for Windows to winrm
transport:
name: ssh

platforms:
- name: ubuntu-12.04
Expand All @@ -272,13 +295,19 @@ platforms:
driver:
image_id: ami-ef5ff086
username: ec2-user
- name: windows-2012R2
transport:
name: winrm
- name: windows-2008R2
ransport:
name: winrm
max_threads: 4

suites:
# ...
```

Both `.kitchen.yml` and `.kitchen.local.yml` files are pre-processed through
ERB which can help to factor out secrets and credentials. For example:
Both `.kitchen.yml` and `.kitchen.local.yml` files are pre-processed through ERB which can help to factor out secrets and credentials. For example:

```yaml
---
Expand Down Expand Up @@ -325,6 +354,7 @@ example:
## <a name="authors"></a> Authors

Created and maintained by [Fletcher Nichol][author] (<[email protected]>)
Windows AMI support added by [Salim Afiune][author] (<[email protected]>) and [Akos Murati][author] (<[email protected]>)

## <a name="license"></a> License

Expand Down
43 changes: 33 additions & 10 deletions data/amis.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"ubuntu-13.10": "ami-45f1a744",
"ubuntu-14.04": "ami-955c0c94",
"centos-6.4": "ami-9ffa709e",
"debian-7.1.0": "ami-f1f064f0"
"debian-7.1.0": "ami-f1f064f0",
"windows-2012r2": "ami-b67e73b7",
"windows-2008r2": "ami-e67e73e7"

},
"ap-southeast-1": {
"ubuntu-10.04": "ami-34713866",
Expand All @@ -18,7 +21,9 @@
"ubuntu-13.10": "ami-02e6b850",
"ubuntu-14.04": "ami-9a7c25c8",
"centos-6.4": "ami-46f5bb14",
"debian-7.1.0": "ami-fe8ac3ac"
"debian-7.1.0": "ami-fe8ac3ac",
"windows-2012r2": "ami-91f4d8c3",
"windows-2008r2": "ami-b9f4d8eb"
},
"ap-southeast-2": {
"ubuntu-10.04": "ami-2f009315",
Expand All @@ -28,7 +33,9 @@
"ubuntu-13.10": "ami-e54423df",
"ubuntu-14.04": "ami-f3b1d6c9",
"centos-6.4": "ami-9352c1a9",
"debian-7.1.0": "ami-4e099a74"
"debian-7.1.0": "ami-4e099a74",
"windows-2012r2": "ami-356d050f",
"windows-2008r2": "ami-096d0533"
},
"eu-west-1": {
"ubuntu-10.04": "ami-bbadb0cf",
Expand All @@ -38,7 +45,10 @@
"ubuntu-13.10": "ami-39eb3f4e",
"ubuntu-14.04": "ami-c112c5b6",
"centos-6.4": "ami-75190b01",
"debian-7.1.0": "ami-954559e1"
"debian-7.1.0": "ami-954559e1",
"windows-2012r2": "ami-1e03bf69",
"windows-2008r2": "ami-c003bfb7"

},
"sa-east-1": {
"ubuntu-10.04": "ami-962c898b",
Expand All @@ -48,7 +58,10 @@
"ubuntu-13.10": "ami-076cc21a",
"ubuntu-14.04": "ami-052b8518",
"centos-6.4": "ami-a665c0bb",
"debian-7.1.0": "ami-b03590ad"
"debian-7.1.0": "ami-b03590ad",
"windows-2012r2": "ami-017ccc1c",
"windows-2008r2": "ami-5d7ccc40"

},
"us-east-1": {
"ubuntu-10.04": "ami-1ab3ce73",
Expand All @@ -58,7 +71,9 @@
"ubuntu-13.10": "ami-a65393ce",
"ubuntu-14.04": "ami-4a915c22",
"centos-6.4": "ami-bf5021d6",
"debian-7.1.0": "ami-50d9a439"
"debian-7.1.0": "ami-50d9a439",
"windows-2012r2": "ami-c4fe9aac",
"windows-2008r2": "ami-f8ff9b90"
},
"us-west-1": {
"ubuntu-10.04": "ami-848ba2c1",
Expand All @@ -68,7 +83,9 @@
"ubuntu-13.10": "ami-bb2a2afe",
"ubuntu-14.04": "ami-d99a9a9c",
"centos-6.4": "ami-5d456c18",
"debian-7.1.0": "ami-1a9bb25f"
"debian-7.1.0": "ami-1a9bb25f",
"windows-2012r2": "ami-cfa5b68a",
"windows-2008r2": "ami-8ba5b6ce"
},
"us-west-2": {
"ubuntu-10.04": "ami-f19407c1",
Expand All @@ -78,7 +95,10 @@
"ubuntu-13.10": "ami-c18ff1f1",
"ubuntu-14.04": "ami-b7720b87",
"centos-6.4": "ami-b3bf2f83",
"debian-7.1.0": "ami-158a1925"
"debian-7.1.0": "ami-158a1925",
"windows-2012r2": "ami-29d18719",
"windows-2008r2": "ami-57d18767"

}
},
"usernames": {
Expand All @@ -89,11 +109,14 @@
"ubuntu-13.10": "ubuntu",
"ubuntu-14.04": "ubuntu",
"centos-6.4": "root",
"debian-7.1.0": "admin"
"debian-7.1.0": "admin",
"windows-2008r2": "administrator",
"windows-2012r2": "administrator"
},
"references": {
"ubuntu": "http://uec-images.ubuntu.com/query/",
"debian": "https://wiki.debian.org/Cloud/AmazonEC2Image",
"centos": "http://wiki.centos.org/Cloud/AWS"
"centos": "http://wiki.centos.org/Cloud/AWS",
"windows": "http://aws.amazon.com/windows/"
}
}
2 changes: 1 addition & 1 deletion kitchen-ec2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.add_dependency 'test-kitchen', '~> 1.0'
gem.add_dependency "test-kitchen", "= 1.4.0.beta.2"
gem.add_dependency 'fog'

gem.add_development_dependency 'rspec'
Expand Down
Loading