kitchen-cloudstack 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95d6263c469eb9ab6b468a9d9cacdf3a66058dca
4
- data.tar.gz: f816c2ae805759fef205d006ace6594bd4072d97
3
+ metadata.gz: 865f50951ffac7b62e92d171f42fff075ad054f1
4
+ data.tar.gz: 0035d0cb62d978978cad8b4ed5627eaa37347015
5
5
  SHA512:
6
- metadata.gz: 97c3f023c158a93b9d386d38f29cd6fb8e3f262902bdfd0fd1513b2ef81e8ca544a1167893447dfa2f0bee26a97d5104ed3026f519629a02e110667405623768
7
- data.tar.gz: 4d273c1a715598968890cf4ef284b4138b0c077ea6dc1ecfd71cf0008fc9245c1a75328874f844585e57fefdfccb667f0c877cea1645f73ccb6d71dfcc501abb
6
+ metadata.gz: 3e0e41ca07d268bba030ffc40d62ecf91cbb71222498569ab0a87b6ce368a9acd3000e66b428e0506136207ae88d320695a7657b73d9279109b339fcc151b453
7
+ data.tar.gz: 4faa04395d32d79552ae715416e04cfdf8cbc33cf2283fe85ec282b3d25187f4ce2b6fd5c73b67a278c3fcec4bec54986d3671d69cc93f70f8b9731916445cf5
data/README.md CHANGED
@@ -25,7 +25,9 @@ Provide, at a minimum, the required driver options in your `.kitchen.yml` file:
25
25
  cloudstack_expunge: [TRUE/FALSE] # Whether or not you want the instance to be expunged, default false.
26
26
  cloudstack_sync_time: [NUMBER OF SECONDS TO WAIT FOR CLOUD-SET-GUEST-PASSWORD/SSHKEY]
27
27
  keypair_search_directory: [PATH TO DIRECTORY (other than ~, ., and ~/.ssh) WITH KEYPAIR PEM FILE]
28
+ cloudstack_project_id: [PROJECT_ID] # To deploy VMs into project.
28
29
  cloudstack_vm_public_ip: [PUBLIC_IP] # In case you use advanced networking and do static NAT manually.
30
+ cloudstack_userdata: "#cloud-config\npackages:\n - htop\n" # double quote required.
29
31
 
30
32
  Then to specify different OS templates,
31
33
 
@@ -21,6 +21,7 @@ require 'kitchen'
21
21
  require 'fog'
22
22
  require 'socket'
23
23
  require 'openssl'
24
+ require 'base64'
24
25
 
25
26
  module Kitchen
26
27
  module Driver
@@ -42,6 +43,7 @@ module Kitchen
42
43
  :cloudstack_host => cloudstack_uri.host,
43
44
  :cloudstack_port => cloudstack_uri.port,
44
45
  :cloudstack_path => cloudstack_uri.path,
46
+ :cloudstack_project_id => config[:cloudstack_project_id],
45
47
  :cloudstack_scheme => cloudstack_uri.scheme
46
48
  )
47
49
  end
@@ -57,6 +59,7 @@ module Kitchen
57
59
  options['keypair'] = config[:cloudstack_ssh_keypair_name]
58
60
  options['diskofferingid'] = config[:cloudstack_diskoffering_id]
59
61
  options['name'] = config[:host_name]
62
+ options[:userdata] = convert_userdata(config[:cloudstack_userdata]) if config[:cloudstack_userdata]
60
63
 
61
64
  options = sanitize(options)
62
65
 
@@ -291,6 +294,14 @@ module Kitchen
291
294
  def sanitize(options)
292
295
  options.reject { |k, v| v.nil? }
293
296
  end
297
+
298
+ def convert_userdata(user_data)
299
+ if user_data.match /^(?:[A-Za-z0-9+\/]{4}\n?)*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/
300
+ user_data
301
+ else
302
+ Base64.encode64(user_data)
303
+ end
304
+ end
294
305
  end
295
306
  end
296
307
  end
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Cloudstack Kitchen driver
24
- CLOUDSTACK_VERSION = "0.21.0"
24
+ CLOUDSTACK_VERSION = "0.22.0"
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-cloudstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Moody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.4.5.1
176
+ rubygems_version: 2.5.1
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Provides an interface for Test Kitchen to be able to run jobs against an