vagrant-cloudstack 0.4.1 → 0.5.0
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 +17 -0
- data/Gemfile +3 -0
- data/README.md +23 -1
- data/build_rpm.sh +1 -1
- data/lib/vagrant-cloudstack/action/run_instance.rb +10 -0
- data/lib/vagrant-cloudstack/config.rb +11 -0
- data/lib/vagrant-cloudstack/errors.rb +4 -0
- data/lib/vagrant-cloudstack/version.rb +1 -1
- data/locales/en.yml +2 -0
- data/spec/vagrant-cloudstack/config_spec.rb +5 -1
- data/vagrant-cloudstack.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8a5fb6d4705653f7d21a743fefd04d85835221b
|
4
|
+
data.tar.gz: 11f800be47556f82ee523d4f2b8d922ff43282f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa716e9e7f67ecf57162a41b4bf22618059a5434fc6150c9774c3123a505b7cc99cfe24202e3a92bab295737120c265b0a42de0a6e221e4bd3ed70ac56ab9117
|
7
|
+
data.tar.gz: ac00112e1d8d52bbe1869e2357e306c33657095612b7db86362cefaaa8cae62e204313d4ca4274952d9d5f44efe8aa517b4866a34e70587af89fcc0db92d117a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
# 0.5.0 (Apr 29, 2014)
|
2
|
+
|
3
|
+
* Use latest version of upstream fog which contains some much needed
|
4
|
+
improvements to the Cloudstack support. Closes #10 for example.
|
5
|
+
|
6
|
+
# 0.4.3 (Apr 15, 2014)
|
7
|
+
|
8
|
+
* Update README to reflect Vagrant version needed
|
9
|
+
|
10
|
+
# 0.4.2 (Apr 15, 2014)
|
11
|
+
|
12
|
+
* Add support for userdata
|
13
|
+
|
14
|
+
# 0.4.1 (Apr 14, 2014)
|
15
|
+
|
16
|
+
* Add support for cygwin paths
|
17
|
+
|
1
18
|
# 0.4.0 (Mar 30, 2014)
|
2
19
|
|
3
20
|
* Fix for Vagrant > =1.5 [GH-29]
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,13 +3,15 @@
|
|
3
3
|
[](https://travis-ci.org/klarna/vagrant-cloudstack)
|
4
4
|
[](http://badge.fury.io/rb/vagrant-cloudstack)
|
5
5
|
[](https://gemnasium.com/klarna/vagrant-cloudstack)
|
6
|
+
[](https://codeclimate.com/github/klarna/vagrant-cloudstac)
|
7
|
+
[](https://coveralls.io/r/klarna/vagrant-cloudstack)
|
6
8
|
|
7
9
|
This is a fork of [mitchellh AWS Provider](https://github.com/mitchellh/vagrant-aws/).
|
8
10
|
|
9
11
|
This is a [Vagrant](http://www.vagrantup.com) 1.2+ plugin that adds an [Cloudstack](http://cloudstack.apache.org)
|
10
12
|
provider to Vagrant.
|
11
13
|
|
12
|
-
**NOTE:** This plugin requires Vagrant 1.
|
14
|
+
**NOTE:** This plugin requires Vagrant 1.5+, since v0.4.0.
|
13
15
|
|
14
16
|
## Features
|
15
17
|
|
@@ -178,6 +180,26 @@ the remote machine over SSH.
|
|
178
180
|
This is good enough for all built-in Vagrant provisioners (shell,
|
179
181
|
chef, and puppet) to work!
|
180
182
|
|
183
|
+
### User data
|
184
|
+
|
185
|
+
You can specify user data for the instance being booted.
|
186
|
+
|
187
|
+
```ruby
|
188
|
+
Vagrant.configure("2") do |config|
|
189
|
+
# ... other stuff
|
190
|
+
|
191
|
+
config.vm.provider :cloudstack do |cloudstack|
|
192
|
+
# Option 1: a single string
|
193
|
+
cloudstack.user_data = "#!/bin/bash\necho 'got user data' > /tmp/user_data.log\necho"
|
194
|
+
|
195
|
+
# Option 2: use a file
|
196
|
+
cloudstack.user_data = File.read("user_data.txt")
|
197
|
+
end
|
198
|
+
end
|
199
|
+
```
|
200
|
+
|
201
|
+
The maximum length of user_data is around 1500 bytes with Cloudstack API < 4.2 ( base64 encoded user_data must be < 2048 bytes)
|
202
|
+
|
181
203
|
## Development
|
182
204
|
|
183
205
|
To work on the `vagrant-cloudstack` plugin, clone this repository out, and use
|
data/build_rpm.sh
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
VERSION=0.
|
2
|
+
VERSION=0.5.0
|
3
3
|
mkdir -p /tmp/vagrant-cloudstack-build_rpm.$$/vagrant-cloudstack-$VERSION
|
4
4
|
cp -r . /tmp/vagrant-cloudstack-build_rpm.$$/vagrant-cloudstack-$VERSION/
|
5
5
|
tar -C /tmp/vagrant-cloudstack-build_rpm.$$/ -czf ~/rpmbuild/SOURCES/vagrant-cloudstack-$VERSION.tar.gz vagrant-cloudstack-$VERSION
|
@@ -42,6 +42,7 @@ module VagrantPlugins
|
|
42
42
|
security_group_ids = domain_config.security_group_ids
|
43
43
|
security_group_names = domain_config.security_group_names
|
44
44
|
security_groups = domain_config.security_groups
|
45
|
+
user_data = domain_config.user_data
|
45
46
|
|
46
47
|
# If there is no keypair then warn the user
|
47
48
|
if !keypair
|
@@ -85,6 +86,7 @@ module VagrantPlugins
|
|
85
86
|
env[:ui].info(" -- Zone UUID: #{zone_id}")
|
86
87
|
env[:ui].info(" -- Network UUID: #{network_id}") if network_id
|
87
88
|
env[:ui].info(" -- Keypair: #{keypair}") if keypair
|
89
|
+
env[:ui].info(" -- User Data: Yes") if user_data
|
88
90
|
if !security_group_ids.nil?
|
89
91
|
security_group_ids.each do |security_group_id|
|
90
92
|
env[:ui].info(" -- Security Group ID: #{security_group_id}")
|
@@ -175,6 +177,14 @@ module VagrantPlugins
|
|
175
177
|
options['project_id'] = project_id if project_id != nil
|
176
178
|
options['key_name'] = keypair if keypair != nil
|
177
179
|
|
180
|
+
if user_data != nil
|
181
|
+
options['user_data'] = Base64.encode64(user_data)
|
182
|
+
if options['user_data'].length > 2048
|
183
|
+
raise Errors::UserdataError,
|
184
|
+
:userdataLength => options['user_data'].length
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
178
188
|
server = env[:cloudstack_compute].servers.create(options)
|
179
189
|
rescue Fog::Compute::Cloudstack::NotFound => e
|
180
190
|
# Invalid subnet doesn't have its own error so we catch and
|
@@ -123,6 +123,12 @@ module VagrantPlugins
|
|
123
123
|
# @return [String]
|
124
124
|
attr_accessor :group
|
125
125
|
|
126
|
+
# The user data string
|
127
|
+
#
|
128
|
+
# @return [String]
|
129
|
+
attr_accessor :user_data
|
130
|
+
|
131
|
+
|
126
132
|
def initialize(domain_specific=false)
|
127
133
|
@host = UNSET_VALUE
|
128
134
|
@path = UNSET_VALUE
|
@@ -147,6 +153,8 @@ module VagrantPlugins
|
|
147
153
|
@group = UNSET_VALUE
|
148
154
|
@security_group_names = UNSET_VALUE
|
149
155
|
@security_groups = UNSET_VALUE
|
156
|
+
@user_data = UNSET_VALUE
|
157
|
+
|
150
158
|
|
151
159
|
# Internal state (prefix with __ so they aren't automatically
|
152
160
|
# merged)
|
@@ -286,6 +294,9 @@ module VagrantPlugins
|
|
286
294
|
# Group must be nil, since we can't default that
|
287
295
|
@group = nil if @group == UNSET_VALUE
|
288
296
|
|
297
|
+
# User Data is nil by default
|
298
|
+
@user_data = nil if @user_data == UNSET_VALUE
|
299
|
+
|
289
300
|
# Compile our domain specific configurations only within
|
290
301
|
# NON-DOMAIN-SPECIFIC configurations.
|
291
302
|
if !@__domain_specific
|
data/locales/en.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require "vagrant-cloudstack/config"
|
2
2
|
|
3
|
+
require 'coveralls'
|
4
|
+
Coveralls.wear!
|
5
|
+
|
3
6
|
describe VagrantPlugins::Cloudstack::Config do
|
4
7
|
let(:instance) { described_class.new }
|
5
8
|
|
@@ -37,6 +40,7 @@ describe VagrantPlugins::Cloudstack::Config do
|
|
37
40
|
its("group") { should be_nil }
|
38
41
|
its("security_group_names") { should be_nil }
|
39
42
|
its("security_groups") { should be_nil }
|
43
|
+
its("user_data") { should be_nil }
|
40
44
|
end
|
41
45
|
|
42
46
|
describe "overriding defaults" do
|
@@ -46,7 +50,7 @@ describe VagrantPlugins::Cloudstack::Config do
|
|
46
50
|
# and asserts the proper result comes back out.
|
47
51
|
[:api_key, :template_id, :zone_id, :instance_ready_timeout,
|
48
52
|
:service_offering_id, :api_key,
|
49
|
-
:secret_key, :network_id].each do |attribute|
|
53
|
+
:secret_key, :network_id, :user_data].each do |attribute|
|
50
54
|
|
51
55
|
it "should not default #{attribute} if overridden" do
|
52
56
|
instance.send("#{attribute}=".to_sym, "foo")
|
data/vagrant-cloudstack.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.required_rubygems_version = ">= 1.3.6"
|
16
16
|
s.rubyforge_project = "vagrant-cloudstack"
|
17
17
|
|
18
|
-
s.add_runtime_dependency "fog", "~> 1.
|
18
|
+
s.add_runtime_dependency "fog", "~> 1.22.0"
|
19
19
|
|
20
20
|
s.add_development_dependency "rake"
|
21
21
|
s.add_development_dependency "rspec-core", "~> 2.14.7"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-cloudstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchell Hashimoto
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date: 2014-04-
|
21
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: fog
|
@@ -26,14 +26,14 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
29
|
+
version: 1.22.0
|
30
30
|
type: :runtime
|
31
31
|
prerelease: false
|
32
32
|
version_requirements: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
34
|
- - ~>
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 1.
|
36
|
+
version: 1.22.0
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rake
|
39
39
|
requirement: !ruby/object:Gem::Requirement
|