kitchen-azurerm 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +16 -7
- data/lib/kitchen/driver/azurerm.rb +27 -5
- metadata +30 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29787238875126ef631e8c8ca2ca7ef3b4bc15a3
|
|
4
|
+
data.tar.gz: bbdbba0261c92a75c3ad7a8504cfb2f5f0af0c27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dcfac8e444314e4b5129ba2d6ac6ff910ca32dc9d7c8838185be25b7d93946141027cbcd914a321a03633b9ece5349581486d5b98312bf8d0366edf9ec296660
|
|
7
|
+
data.tar.gz: 140e5bccad525b46067d5eaee07b8b2a97c24974ac8e3c5e3815cad06d10b3c4787bb7c7eef467999d41928ee0259fbe1bff4434855c8bfe196e4c7892ba0d31
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# knife-azurerm Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.2] - 2015-12-10
|
|
4
|
+
- Add an option for users to specify a custom script for WinRM (support Windows 2008 R2) (@andrewelizondo)
|
|
5
|
+
- Add azure_management_url parameter for Azure Stack support (@andrewelizondo)
|
|
6
|
+
|
|
3
7
|
## [0.2.1] - 2015-10-06
|
|
4
8
|
- Pointing to updated Azure SDK for Ruby, supports Linux
|
|
5
9
|
|
data/README.md
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
**kitchen-azurerm** is a driver for the popular test harness [Test Kitchen](http://kitchen.ci) that allows Microsoft Azure resources to be provisioned prior to testing. This driver uses the new Microsoft Azure Resource Management REST API via the [azure-sdk-for-ruby](https://github.com/azure/azure-sdk-for-ruby).
|
|
4
4
|
|
|
5
|
-
[](http://badge.fury.io/rb/kitchen-azurerm)
|
|
5
|
+
[](http://badge.fury.io/rb/kitchen-azurerm) [](https://travis-ci.org/pendrica/kitchen-azurerm)
|
|
6
6
|
|
|
7
|
-
This version has been tested on Windows
|
|
8
|
-
|
|
9
|
-
## Known issues
|
|
10
|
-
- Azure SDK for Ruby has blocking issues on Linux environments, this is being tracked here: (https://github.com/Azure/azure-sdk-for-ruby/pull/282)
|
|
7
|
+
This version has been tested on Windows, OS/X and Ubuntu. If you encounter a problem on your platform, please raise an issue.
|
|
11
8
|
|
|
12
9
|
## Quick-start
|
|
13
10
|
### Installation
|
|
@@ -23,7 +20,7 @@ For the driver to interact with the Microsoft Azure Resource management REST API
|
|
|
23
20
|
|
|
24
21
|
You will essentially need 4 parameters from the above article to configure kitchen-azurerm: **Subscription ID**, **Client ID**, **Client Secret/Password** and **Tenant ID**. These can be easily obtained using the azure-cli tools (v0.9.8 or higher) on any platform.
|
|
25
22
|
|
|
26
|
-
Using a text editor, open or create the file ```~/.azure/credentials``` and add the following section, noting there is one section per Subscription ID.
|
|
23
|
+
Using a text editor, open or create the file ```~/.azure/credentials``` and add the following section, noting there is one section per Subscription ID. **Make sure you save the file with UTF-8 encoding**
|
|
27
24
|
|
|
28
25
|
```ruby
|
|
29
26
|
[abcd1234-YOUR-GUID-HERE-abcdef123456]
|
|
@@ -66,6 +63,7 @@ platforms:
|
|
|
66
63
|
- name: ubuntu-14.04
|
|
67
64
|
driver_config:
|
|
68
65
|
image_urn: Canonical:UbuntuServer:14.04.3-LTS:latest
|
|
66
|
+
vm_name: trusty-vm
|
|
69
67
|
- name: ubuntu-15.04
|
|
70
68
|
driver_config:
|
|
71
69
|
image_urn: Canonical:UbuntuServer:15.04:latest
|
|
@@ -107,7 +105,18 @@ platforms:
|
|
|
107
105
|
image_urn: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest
|
|
108
106
|
transport:
|
|
109
107
|
name: winrm
|
|
110
|
-
|
|
108
|
+
- name: windows2008-r2
|
|
109
|
+
driver_config:
|
|
110
|
+
image_urn: MicrosoftWindowsServer:WindowsServer:2008-R2-SP1:latest
|
|
111
|
+
winrm_powershell_script: |-
|
|
112
|
+
winrm quickconfig -q
|
|
113
|
+
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
|
|
114
|
+
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
|
|
115
|
+
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
|
|
116
|
+
winrm set winrm/config/service/auth '@{Basic="true"}'
|
|
117
|
+
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=public protocol=tcp localport=5985 remoteip=localsubnet new remoteip=any
|
|
118
|
+
transport:
|
|
119
|
+
name: winrm
|
|
111
120
|
suites:
|
|
112
121
|
- name: default
|
|
113
122
|
run_list:
|
|
@@ -29,14 +29,28 @@ module Kitchen
|
|
|
29
29
|
'P2ssw0rd'
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
default_config(:vm_name) do |_config|
|
|
33
|
+
'vm'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
default_config(:winrm_powershell_script) do |_config|
|
|
37
|
+
false
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
default_config(:azure_management_url) do |_config|
|
|
41
|
+
'https://management.azure.com'
|
|
42
|
+
end
|
|
43
|
+
|
|
32
44
|
def create(state)
|
|
33
|
-
state[:uuid] =
|
|
45
|
+
state[:uuid] = SecureRandom.hex(8)
|
|
34
46
|
formatted_time = Time.now.utc.strftime '%Y%m%dT%H%M%S'
|
|
35
47
|
state[:azure_resource_group_name] = "#{config[:azure_resource_group_name]}-#{formatted_time}"
|
|
36
48
|
state[:subscription_id] = config[:subscription_id]
|
|
37
49
|
state[:username] = config[:username]
|
|
38
50
|
state[:password] = config[:password]
|
|
39
51
|
state[:server_id] = "vm#{state[:uuid]}"
|
|
52
|
+
state[:vm_name] = config[:vm_name]
|
|
53
|
+
state[:azure_management_url] = config[:azure_management_url]
|
|
40
54
|
image_publisher, image_offer, image_sku, image_version = config[:image_urn].split(':', 4)
|
|
41
55
|
deployment_parameters = {
|
|
42
56
|
location: config[:location],
|
|
@@ -48,7 +62,8 @@ module Kitchen
|
|
|
48
62
|
imagePublisher: image_publisher,
|
|
49
63
|
imageOffer: image_offer,
|
|
50
64
|
imageSku: image_sku,
|
|
51
|
-
imageVersion: image_version
|
|
65
|
+
imageVersion: image_version,
|
|
66
|
+
vmName: state[:vm_name]
|
|
52
67
|
}
|
|
53
68
|
|
|
54
69
|
credentials = Kitchen::Driver::Credentials.new.azure_credentials_for_subscription(config[:subscription_id])
|
|
@@ -148,7 +163,7 @@ module Kitchen
|
|
|
148
163
|
def destroy(state)
|
|
149
164
|
return if state[:server_id].nil?
|
|
150
165
|
credentials = Kitchen::Driver::Credentials.new.azure_credentials_for_subscription(state[:subscription_id])
|
|
151
|
-
resource_management_client = ::Azure::ARM::Resources::ResourceManagementClient.new(credentials)
|
|
166
|
+
resource_management_client = ::Azure::ARM::Resources::ResourceManagementClient.new(credentials, state[:azure_management_url])
|
|
152
167
|
resource_management_client.subscription_id = state[:subscription_id]
|
|
153
168
|
begin
|
|
154
169
|
info "Destroying Resource Group: #{state[:azure_resource_group_name]}"
|
|
@@ -165,7 +180,7 @@ module Kitchen
|
|
|
165
180
|
end
|
|
166
181
|
|
|
167
182
|
def enable_winrm_powershell_script
|
|
168
|
-
<<-PS1
|
|
183
|
+
config[:winrm_powershell_script] || <<-PS1
|
|
169
184
|
New-SelfSignedCertificate -DnsName $env:COMPUTERNAME -CertStoreLocation Cert:\\LocalMachine\\My
|
|
170
185
|
$cert = New-SelfSignedCertificate -DnsName $env:COMPUTERNAME -CertStoreLocation Cert:\\LocalMachine\\My
|
|
171
186
|
$config = '@{CertificateThumbprint="' + $cert.Thumbprint + '"}'
|
|
@@ -268,6 +283,13 @@ New-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)" -Name "Wi
|
|
|
268
283
|
"metadata": {
|
|
269
284
|
"description": "Either a date or latest."
|
|
270
285
|
}
|
|
286
|
+
},
|
|
287
|
+
"vmName": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"defaultValue": "vm",
|
|
290
|
+
"metadata": {
|
|
291
|
+
"description": "The vm name created inside of the resource group."
|
|
292
|
+
}
|
|
271
293
|
}
|
|
272
294
|
},
|
|
273
295
|
"variables": {
|
|
@@ -281,7 +303,7 @@ New-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)" -Name "Wi
|
|
|
281
303
|
"publicIPAddressName": "publicip",
|
|
282
304
|
"publicIPAddressType": "Dynamic",
|
|
283
305
|
"vmStorageAccountContainerName": "vhds",
|
|
284
|
-
"vmName": "
|
|
306
|
+
"vmName": "[parameters('vmName')]",
|
|
285
307
|
"vmSize": "[parameters('vmSize')]",
|
|
286
308
|
"virtualNetworkName": "vnet",
|
|
287
309
|
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-azurerm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stuart Preston
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10
|
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: inifile
|
|
@@ -80,6 +80,34 @@ dependencies:
|
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '10.0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rubocop
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rspec
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
83
111
|
description: Test Kitchen driver for the Microsoft Azure Resource Manager (ARM) API
|
|
84
112
|
email:
|
|
85
113
|
- stuart@pendrica.com
|