vagrant-openstack-plugin 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +4 -1
- data/lib/vagrant-openstack-plugin/action/create_server.rb +19 -3
- data/lib/vagrant-openstack-plugin/action/read_ssh_info.rb +10 -6
- data/lib/vagrant-openstack-plugin/errors.rb +4 -0
- data/lib/vagrant-openstack-plugin/version.rb +1 -1
- data/locales/en.yml +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4976e05ab97957b747ce3dae9d7fc11aaf54f74
|
4
|
+
data.tar.gz: b3b2758a7ac7d5469d0f15a14a4eaff1a85af7e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a5e64bb5ce88778ba6572a9939a7ef8d1253d00d1fdb3180dda49b0defb7a998b49f9d03bb0f42d4c22956854f6346e39bb796525aca107620a1cfa6d5e364
|
7
|
+
data.tar.gz: b61c45b9fdfdeb03a50f2ba88c4d2425b112ffe397d720f9ff7baec6e7e3e7788ba5885555c4d464a936d0ac375453533cb5f58617ec54538b4f41f0922c2e1a
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,17 @@
|
|
1
1
|
# Changelog for vagrant-openstack-plugin
|
2
2
|
|
3
|
+
## 0.6.0
|
4
|
+
|
5
|
+
- Merge pull request #59 from virtuald/fixed_automatic_ip [view commit](http://github.com///commit/7e7867ee7340515a8d0171fe5ea88aa340646e0f)
|
6
|
+
- Update README with additional information about automatic allocation [view commit](http://github.com///commit/ea4ee9f409f61a2583588d3782701fe66239bd24)
|
7
|
+
- Allow address_id to use the automatically assigned floating ip [view commit](http://github.com///commit/cb0e29c20e7105dae2a6534ccaebbe656c0d8419)
|
8
|
+
- Update README [view commit](http://github.com///commit/b26f70653fb7cfbfe9604031d82aa42d4a324421)
|
9
|
+
- Add support for automatically allocating a floating IP [view commit](http://github.com///commit/aee3129fc6020d3e3a6cc8db28b9b1c812225fbc)
|
10
|
+
- update changelog [view commit](http://github.com///commit/936a2eef3d802d65a9f0753b5652ef4a8dbdb345)
|
11
|
+
|
3
12
|
## 0.5.0
|
4
13
|
|
14
|
+
|
5
15
|
- Merge pull request #45 from detiber/fixNetworksPR [view commit](http://github.com///commit/56b28eff5a1079c6805ec944b1a0c1dde458b10e)
|
6
16
|
- Merge pull request #53 from tjheeta/remote_machine_id [view commit](http://github.com///commit/5873d1b5282fe2d24a0e725ec6289d1ba5e20e9b)
|
7
17
|
- Merge pull request #54 from last-g/patch-1 [view commit](http://github.com///commit/7941573ef8f547a915e31c51ab4d1b85b878eebe)
|
data/README.md
CHANGED
@@ -128,7 +128,8 @@ This provider exposes quite a few provider-specific configuration options:
|
|
128
128
|
vagrant network configurations.
|
129
129
|
* `networks` - An array of names or ids to create a server with multiple network interfaces. This overrides the `network` setting.
|
130
130
|
* `address_id` - A specific address identifier to use when connecting to the
|
131
|
-
instance. `network` has higher precedence.
|
131
|
+
instance. `network` has higher precedence. If set to :floating_ip, then
|
132
|
+
the floating IP address will be used.
|
132
133
|
* `scheduler_hints` - Pass hints to the open stack scheduler, see `--hint` flag in [OpenStack filters doc](http://docs.openstack.org/trunk/openstack-compute/admin/content/scheduler-filters.html)
|
133
134
|
* `availability_zone` - Specify the availability zone in which the instance
|
134
135
|
must be created.
|
@@ -137,6 +138,8 @@ This provider exposes quite a few provider-specific configuration options:
|
|
137
138
|
* `region` - Region Name. Specify the region you want the instance to be launched in for multi-region environments.
|
138
139
|
* `proxy` - HTTP proxy. When behind a firewall override this value for API access.
|
139
140
|
* `ssl_verify_peer` - sets the ssl_verify_peer on the underlying excon connection - useful for self signed certs etc.
|
141
|
+
* `floating_ip` - Floating ip. The floating IP to assign for this instance. If
|
142
|
+
set to :auto, then this assigns any available floating IP to the instance.
|
140
143
|
|
141
144
|
These can be set like typical provider-specific configuration:
|
142
145
|
|
@@ -95,11 +95,27 @@ module VagrantPlugins
|
|
95
95
|
begin
|
96
96
|
server.wait_for(5) { ready? }
|
97
97
|
# Once the server is up and running assign a floating IP if we have one
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
floating_ip = config.floating_ip
|
99
|
+
# try to automatically allocate a floating IP
|
100
|
+
if floating_ip.to_sym == :auto
|
101
|
+
addresses = env[:openstack_compute].addresses
|
102
|
+
puts addresses
|
103
|
+
free_floating = addresses.find_index {|a| a.fixed_ip.nil?}
|
104
|
+
if free_floating.nil?
|
105
|
+
raise Errors::FloatingIPNotFound
|
106
|
+
end
|
107
|
+
floating_ip = addresses[free_floating].ip
|
108
|
+
end
|
109
|
+
|
110
|
+
if floating_ip
|
111
|
+
env[:ui].info( "Using floating IP #{floating_ip}")
|
112
|
+
floater = env[:openstack_compute].addresses.find { |thisone| thisone.ip.eql? floating_ip }
|
101
113
|
floater.server = server
|
102
114
|
end
|
115
|
+
|
116
|
+
# store this so we can use it later
|
117
|
+
env[:floating_ip] = floating_ip
|
118
|
+
|
103
119
|
rescue RuntimeError => e
|
104
120
|
# If we don't have an error about a state transition, then
|
105
121
|
# we just move on.
|
@@ -12,12 +12,12 @@ module VagrantPlugins
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
-
env[:machine_ssh_info] = read_ssh_info(env[:openstack_compute], env[:machine])
|
15
|
+
env[:machine_ssh_info] = read_ssh_info(env[:openstack_compute], env[:machine], env[:floating_ip])
|
16
16
|
|
17
17
|
@app.call(env)
|
18
18
|
end
|
19
19
|
|
20
|
-
def read_ssh_info(openstack, machine)
|
20
|
+
def read_ssh_info(openstack, machine, floating_ip)
|
21
21
|
id = machine.id || openstack.servers.all( :name => machine.name ).first.id rescue nil
|
22
22
|
return nil if id.nil?
|
23
23
|
server = openstack.servers.get(id)
|
@@ -38,7 +38,11 @@ module VagrantPlugins
|
|
38
38
|
if config.network
|
39
39
|
host = server.addresses[config.network].last['addr'] rescue nil
|
40
40
|
else
|
41
|
-
|
41
|
+
if config.address_id.to_sym == :floating_ip
|
42
|
+
host = floating_ip
|
43
|
+
else
|
44
|
+
host = server.addresses[config.address_id].last['addr'] rescue nil
|
45
|
+
end
|
42
46
|
end
|
43
47
|
|
44
48
|
# If host is still nil, try to find the IP address another way
|
@@ -46,10 +50,10 @@ module VagrantPlugins
|
|
46
50
|
@logger.debug("Was unable to determine what network to use. Trying to find a valid IP to use.")
|
47
51
|
if server.public_ip_addresses.length > 0
|
48
52
|
@logger.debug("Public IP addresses available: #{server.public_ip_addresses}")
|
49
|
-
if
|
50
|
-
if server.public_ip_addresses.include?(
|
53
|
+
if floating_ip
|
54
|
+
if server.public_ip_addresses.include?(floating_ip)
|
51
55
|
@logger.debug("Using the floating IP defined in Vagrantfile.")
|
52
|
-
host =
|
56
|
+
host = machine.floating_ip
|
53
57
|
else
|
54
58
|
@logger.debug("The floating IP that was specified is not available to this instance.")
|
55
59
|
raise Errors::FloatingIPNotValid
|
data/locales/en.yml
CHANGED
@@ -62,6 +62,9 @@ en:
|
|
62
62
|
floating_ip_not_valid: |-
|
63
63
|
The floating IP specified in the Vagrantfile does not match an
|
64
64
|
available public IP address returned by OpenStack.
|
65
|
+
floating_ip_not_found: |-
|
66
|
+
A floating IP could not be allocated, as no available floating
|
67
|
+
IPs were found in OpenStack
|
65
68
|
states:
|
66
69
|
short_active: |-
|
67
70
|
active
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-openstack-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Haselwanter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog
|