kitchen-cloudstack 0.1.2 → 0.1.3

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.
data/README.md CHANGED
@@ -23,6 +23,7 @@ Provide, at a minimum, the required driver options in your `.kitchen.yml` file:
23
23
  require_chef_omnibus: latest (if you'll be using Chef)
24
24
  OPTIONAL
25
25
  cloudstack_sync_time: [NUMBER OF SECONDS TO WAIT FOR CLOUD-SET-GUEST-PASSWORD/SSHKEY]
26
+ keypair_search_directory: [PATH TO DIRECTORY (other than ~, ., and ~/.ssh) WITH KEYPAIR PEM FILE]
26
27
 
27
28
  Then to specify different OS templates,
28
29
 
@@ -34,9 +35,12 @@ Then to specify different OS templates,
34
35
  cloudstack_security_group_id: [SECURITY GROUP ID FOR SHARED NETWORKS]
35
36
  OPTIONAL
36
37
  cloudstack_ssh_keypair_name: [SSH KEY NAME]
38
+ cloudstack_sync_time: [NUMBER OF SECONDS TO WAIT FOR CLOUD-SET-GUEST-PASSWORD/SSHKEY]
37
39
  To use the CloudStack public key provider, you need to have the .PEM file located in the same directory as
38
- your .kitchen.yml file, your home directory (~), or your .ssh directory (~/.ssh/) and it must be named the same as the
39
- Keypair on CloudStack suffixed with .pem.
40
+ your .kitchen.yml file, your home directory (~), your .ssh directory (~/.ssh/), or specify a directory (without any
41
+ trailing slahses) as your "keypair_search_directory" and the file be named the same as the Keypair on CloudStack
42
+ suffixed with .pem (e.g. the Keypair named "TestKey" should be located in one of the searched directories and named
43
+ "TestKey.pem").
40
44
 
41
45
  By default, a unique server name will be generated and the randomly generated password will be used, though that
42
46
  behavior can be overridden with additional options (e.g., to specify a SSH private key):
@@ -18,7 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'test-kitchen', '~> 1.0.0.alpha.3'
21
+ spec.add_dependency 'test-kitchen', '~> 1.0.0.alpha.6'
22
+ spec.add_dependency 'fog', ">=1.10.1"
23
+ spec.add_dependency 'net-ssh-multi'
22
24
 
23
25
  spec.add_development_dependency 'bundler', '~> 1.3'
24
26
  spec.add_development_dependency 'rake'
@@ -54,15 +54,18 @@ module Kitchen
54
54
  options['templateid'] = config[:cloudstack_template_id]
55
55
  options['displayname'] = config[:name]
56
56
  options['serviceofferingid'] = config[:cloudstack_serviceoffering_id]
57
+ if (!config[:cloudstack_network_id].nil?)
58
+ options['networkids'] = config[:cloudstack_network_id]
59
+ end
60
+
57
61
  if (!config[:cloudstack_security_group_id].nil?)
58
62
  options['securitygroupids'] = config[:cloudstack_security_group_id]
59
63
  end
60
- if (!config[:cloudstack_network_id].nil?)
61
- options['networkids'] = config[:cloudstack_security_group_id]
62
- end
64
+
63
65
  if (!config[:cloudstack_ssh_keypair_name].nil?)
64
66
  options['keypair'] = config[:cloudstack_ssh_keypair_name]
65
67
  end
68
+
66
69
  debug(options)
67
70
  compute.deploy_virtual_machine(options)
68
71
  end
@@ -107,7 +110,9 @@ module Kitchen
107
110
 
108
111
  keypair = nil
109
112
  password = nil
110
- if File.exist?("./#{config[:cloudstack_ssh_keypair_name]}.pem")
113
+ if ((!config[:keypair_search_directory].nil?) and (File.exist?("#{config[:keypair_search_directory]}/#{config[:cloudstack_ssh_keypair_name]}.pem")))
114
+ keypair = "#{config[:keypair_search_directory]}/#{config[:cloudstack_ssh_keypair_name]}.pem"
115
+ elsif File.exist?("./#{config[:cloudstack_ssh_keypair_name]}.pem")
111
116
  keypair = "./#{config[:cloudstack_ssh_keypair_name]}.pem"
112
117
  elsif File.exist?("~/#{config[:cloudstack_ssh_keypair_name]}.pem")
113
118
  keypair = "~/#{config[:cloudstack_ssh_keypair_name]}.pem"
@@ -121,6 +126,7 @@ module Kitchen
121
126
  state[:hostname] = server_info.fetch('nic').first.fetch('ipaddress')
122
127
 
123
128
  if (!keypair.nil?)
129
+ debug("Using keypair: #{keypair}")
124
130
  info("SSH for #{state[:hostname]} with keypair #{config[:cloudstack_ssh_keypair_name]}.")
125
131
  ssh = Fog::SSH.new(state[:hostname], config[:username], {:keys => keypair})
126
132
  debug(state[:hostname])
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Cloudstack Kitchen driver
24
- CLOUDSTACK_VERSION = "0.1.2"
24
+ CLOUDSTACK_VERSION = "0.1.3"
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-cloudstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-01 00:00:00.000000000 Z
12
+ date: 2013-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-kitchen
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.0.alpha.3
21
+ version: 1.0.0.alpha.6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,39 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.0.alpha.3
29
+ version: 1.0.0.alpha.6
30
+ - !ruby/object:Gem::Dependency
31
+ name: fog
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.10.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.10.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: net-ssh-multi
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
30
62
  - !ruby/object:Gem::Dependency
31
63
  name: bundler
32
64
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
195
  version: '0'
164
196
  requirements: []
165
197
  rubyforge_project:
166
- rubygems_version: 1.8.25
198
+ rubygems_version: 1.8.24
167
199
  signing_key:
168
200
  specification_version: 3
169
201
  summary: A Test Kitchen Driver for Cloudstack