vagrant-google 0.2.5 → 1.0.0.rc0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +2 -2
- data/Gemfile +4 -5
- data/README.md +5 -4
- data/lib/vagrant-google/action/read_ssh_info.rb +15 -2
- data/lib/vagrant-google/action/run_instance.rb +6 -0
- data/lib/vagrant-google/config.rb +26 -0
- data/lib/vagrant-google/version.rb +1 -1
- data/vagrant-google.gemspec +7 -3
- data/vagrantfile_examples/Vagrantfile.simple +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986539c1bfd5784cb5732d473915fc64bc101aad
|
4
|
+
data.tar.gz: 7f9132a241dc5786c4d171d4c1180fc1c28471fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f9216128e01feb318d17920cc15ecb50294ff82bb28d4dd9550379d2fa9007aeccf7d458124e40300b9c65ee0a61de4b94b888476939d7a909ef4fbcecc0b9
|
7
|
+
data.tar.gz: 7537253a0dde9d6d842b35e8453894da3dee4a4145b3f6cdb32832000c732f4f007b85ea67f4684db731aa91969f749c7ead68d72044da67d267096ed15d81de
|
data/.ruby-version
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
2.
|
2
|
-
# Tracking Vagrant 1.
|
1
|
+
2.3.0
|
2
|
+
# Tracking Vagrant 1.9.7
|
data/Gemfile
CHANGED
@@ -14,7 +14,10 @@
|
|
14
14
|
|
15
15
|
source "https://rubygems.org"
|
16
16
|
|
17
|
-
|
17
|
+
group :plugins do
|
18
|
+
# Dependencies need to be specified in vagrant-google.gemspec
|
19
|
+
gemspec
|
20
|
+
end
|
18
21
|
|
19
22
|
group :development do
|
20
23
|
# We depend on Vagrant for development, but we don't add it as a
|
@@ -23,7 +26,3 @@ group :development do
|
|
23
26
|
gem 'vagrant', git: "https://github.com/mitchellh/vagrant.git"
|
24
27
|
gem 'vagrant-spec', git: "https://github.com/mitchellh/vagrant-spec.git"
|
25
28
|
end
|
26
|
-
|
27
|
-
group :plugins do
|
28
|
-
gem "vagrant-google" , path: "."
|
29
|
-
end
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# Vagrant Google Compute Engine (GCE) Provider
|
2
2
|
|
3
|
-
|
3
|
+
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/vagrant-google.png)][gem]
|
5
5
|
[![Dependency Status](https://gemnasium.com/mitchellh/vagrant-google.png)][gemnasium]
|
6
|
-
</span>
|
7
6
|
|
8
7
|
[gem]: https://rubygems.org/gems/vagrant-google
|
9
8
|
[gemnasium]: https://gemnasium.com/mitchellh/vagrant-google
|
@@ -12,7 +11,7 @@ This is a [Vagrant](http://www.vagrantup.com) 1.2+ plugin that adds an
|
|
12
11
|
[Google Compute Engine](http://cloud.google.com/compute/) (GCE) provider to
|
13
12
|
Vagrant, allowing Vagrant to control and provision instances in GCE.
|
14
13
|
|
15
|
-
|
14
|
+
The maintainers for this plugin are @temikus(primary), @erjohnso(backup).
|
16
15
|
|
17
16
|
## Features
|
18
17
|
|
@@ -188,10 +187,12 @@ This provider exposes quite a few provider-specific configuration options:
|
|
188
187
|
e.g. 10/08/2015 13:15:15 is "i-2015081013-15637fda".
|
189
188
|
* `network` - The name of the network to use for the instance. Default is
|
190
189
|
"default".
|
190
|
+
* `subnetwork` - The name of the subnetwork to use for the instance.
|
191
191
|
* `tags` - An array of tags to apply to this instance.
|
192
192
|
* `zone` - The zone name where the instance will be created.
|
193
193
|
* `can_ip_forward` - Boolean whether to enable IP Forwarding.
|
194
|
-
* `external_ip` - The external IP address to use (supports names).
|
194
|
+
* `external_ip` - The external IP address to use (supports names). Set to `false` to not assign an external address.
|
195
|
+
* `use_private_ip` - Boolean whether to use private IP for SSH/provisioning. Default is false.
|
195
196
|
* `preemptible` - Boolean whether to enable preemptibility. Default is false.
|
196
197
|
* `auto_restart` - Boolean whether to enable auto_restart. Default is true.
|
197
198
|
* `on_host_maintenance` - What to do on host maintenance. Default is "MIGRATE".
|
@@ -42,11 +42,24 @@ module VagrantPlugins
|
|
42
42
|
return nil
|
43
43
|
end
|
44
44
|
|
45
|
-
#
|
46
|
-
|
45
|
+
# Get private_ip setting
|
46
|
+
use_private_ip = machine.provider_config.get_zone_config(zone).use_private_ip
|
47
|
+
|
48
|
+
# Default to use public ip address
|
49
|
+
ssh_info = {
|
47
50
|
:host => server.public_ip_address,
|
48
51
|
:port => 22
|
49
52
|
}
|
53
|
+
|
54
|
+
if use_private_ip then
|
55
|
+
ssh_info = {
|
56
|
+
:host => server.private_ip_address,
|
57
|
+
:port => 22
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Return SSH network info
|
62
|
+
return ssh_info
|
50
63
|
end
|
51
64
|
end
|
52
65
|
end
|
@@ -50,9 +50,11 @@ module VagrantPlugins
|
|
50
50
|
disk_name = zone_config.disk_name
|
51
51
|
disk_type = zone_config.disk_type
|
52
52
|
network = zone_config.network
|
53
|
+
subnetwork = zone_config.subnetwork
|
53
54
|
metadata = zone_config.metadata
|
54
55
|
tags = zone_config.tags
|
55
56
|
can_ip_forward = zone_config.can_ip_forward
|
57
|
+
use_private_ip = zone_config.use_private_ip
|
56
58
|
external_ip = zone_config.external_ip
|
57
59
|
preemptible = zone_config.preemptible
|
58
60
|
auto_restart = zone_config.auto_restart
|
@@ -71,9 +73,11 @@ module VagrantPlugins
|
|
71
73
|
env[:ui].info(" -- Instance Group: #{instance_group}")
|
72
74
|
env[:ui].info(" -- Zone: #{zone}") if zone
|
73
75
|
env[:ui].info(" -- Network: #{network}") if network
|
76
|
+
env[:ui].info(" -- Subnetwork: #{subnetwork}") if subnetwork
|
74
77
|
env[:ui].info(" -- Metadata: '#{metadata}'")
|
75
78
|
env[:ui].info(" -- Tags: '#{tags}'")
|
76
79
|
env[:ui].info(" -- IP Forward: #{can_ip_forward}")
|
80
|
+
env[:ui].info(" -- Use private IP: #{use_private_ip}")
|
77
81
|
env[:ui].info(" -- External IP: #{external_ip}")
|
78
82
|
env[:ui].info(" -- Preemptible: #{preemptible}")
|
79
83
|
env[:ui].info(" -- Auto Restart: #{auto_restart}")
|
@@ -124,9 +128,11 @@ module VagrantPlugins
|
|
124
128
|
:disk_type => disk_type,
|
125
129
|
:image => image,
|
126
130
|
:network => network,
|
131
|
+
:subnetwork => subnetwork,
|
127
132
|
:metadata => metadata,
|
128
133
|
:tags => tags,
|
129
134
|
:can_ip_forward => can_ip_forward,
|
135
|
+
:use_private_ip => use_private_ip,
|
130
136
|
:external_ip => external_ip,
|
131
137
|
:preemptible => preemptible,
|
132
138
|
:auto_restart => auto_restart,
|
@@ -82,6 +82,11 @@ module VagrantPlugins
|
|
82
82
|
# @return [String]
|
83
83
|
attr_accessor :network
|
84
84
|
|
85
|
+
# The name of the subnetwork
|
86
|
+
#
|
87
|
+
# @return [String]
|
88
|
+
attr_accessor :subnetwork
|
89
|
+
|
85
90
|
# Tags to apply to the instance
|
86
91
|
#
|
87
92
|
# @return [Array]
|
@@ -97,6 +102,11 @@ module VagrantPlugins
|
|
97
102
|
# @return String
|
98
103
|
attr_accessor :external_ip
|
99
104
|
|
105
|
+
# Use private ip address
|
106
|
+
#
|
107
|
+
# @return Boolean
|
108
|
+
attr_accessor :use_private_ip
|
109
|
+
|
100
110
|
# whether to autodelete disk on instance delete
|
101
111
|
#
|
102
112
|
# @return Boolean
|
@@ -154,9 +164,11 @@ module VagrantPlugins
|
|
154
164
|
@metadata = {}
|
155
165
|
@name = UNSET_VALUE
|
156
166
|
@network = UNSET_VALUE
|
167
|
+
@subnetwork = UNSET_VALUE
|
157
168
|
@tags = []
|
158
169
|
@can_ip_forward = UNSET_VALUE
|
159
170
|
@external_ip = UNSET_VALUE
|
171
|
+
@use_private_ip = UNSET_VALUE
|
160
172
|
@autodelete_disk = UNSET_VALUE
|
161
173
|
@preemptible = UNSET_VALUE
|
162
174
|
@auto_restart = UNSET_VALUE
|
@@ -204,6 +216,11 @@ module VagrantPlugins
|
|
204
216
|
@__zone_config[zone] << block if block_given?
|
205
217
|
end
|
206
218
|
|
219
|
+
def expand_path(path, root_path)
|
220
|
+
return path if not path
|
221
|
+
return Pathname.new(path).expand_path(root_path)
|
222
|
+
end
|
223
|
+
|
207
224
|
#-------------------------------------------------------------------
|
208
225
|
# Internal methods.
|
209
226
|
#-------------------------------------------------------------------
|
@@ -269,6 +286,9 @@ module VagrantPlugins
|
|
269
286
|
# Network defaults to 'default'
|
270
287
|
@network = "default" if @network == UNSET_VALUE
|
271
288
|
|
289
|
+
# Subnetwork defaults to nil
|
290
|
+
@subnetwork = nil if @subnetwork == UNSET_VALUE
|
291
|
+
|
272
292
|
# Default zone is us-central1-f.
|
273
293
|
@zone = "us-central1-f" if @zone == UNSET_VALUE
|
274
294
|
|
@@ -281,6 +301,9 @@ module VagrantPlugins
|
|
281
301
|
# external_ip defaults to nil
|
282
302
|
@external_ip = nil if @external_ip == UNSET_VALUE
|
283
303
|
|
304
|
+
# use_private_ip defaults to false
|
305
|
+
@use_private_ip = false if @use_private_ip == UNSET_VALUE
|
306
|
+
|
284
307
|
# preemptible defaults to false
|
285
308
|
@preemptible = false if @preemptible == UNSET_VALUE
|
286
309
|
|
@@ -329,6 +352,9 @@ module VagrantPlugins
|
|
329
352
|
if @zone
|
330
353
|
config = get_zone_config(@zone)
|
331
354
|
|
355
|
+
config.google_key_location = expand_path(config.google_key_location, machine.env.root_path)
|
356
|
+
config.google_json_key_location = expand_path(config.google_json_key_location, machine.env.root_path)
|
357
|
+
|
332
358
|
errors << I18n.t("vagrant_google.config.google_project_id_required") if \
|
333
359
|
config.google_project_id.nil?
|
334
360
|
errors << I18n.t("vagrant_google.config.google_client_email_required") if \
|
data/vagrant-google.gemspec
CHANGED
@@ -28,12 +28,16 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.required_rubygems_version = ">= 1.3.6"
|
29
29
|
s.rubyforge_project = "vagrant-google"
|
30
30
|
|
31
|
-
s.add_runtime_dependency "fog-google", "~> 0.
|
32
|
-
s.add_runtime_dependency "google-api-client", "< 0.9", "
|
31
|
+
s.add_runtime_dependency "fog-google", "~> 0.5.3"
|
32
|
+
s.add_runtime_dependency "google-api-client", "< 0.9", "> 0.8.5"
|
33
33
|
|
34
34
|
s.add_development_dependency "pry"
|
35
35
|
s.add_development_dependency "pry-byebug"
|
36
|
-
|
36
|
+
|
37
|
+
# This is a restriction to avoid an error "undefined method 'last_comment'"
|
38
|
+
# which is deprecated (see https://github.com/ruby/rake/issues/116)
|
39
|
+
# Remove it after update rspec-core to version greater than or equal to 3.4.4
|
40
|
+
s.add_development_dependency "rake", "< 11.0"
|
37
41
|
s.add_development_dependency "rspec", "~> 2.14"
|
38
42
|
s.add_development_dependency "rubocop", "~> 0.35"
|
39
43
|
s.add_development_dependency "highline"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.rc0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Johnson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog-google
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.5.3
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.5.3
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: google-api-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -32,9 +32,9 @@ dependencies:
|
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0.9'
|
35
|
-
- - "
|
35
|
+
- - ">"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.
|
37
|
+
version: 0.8.5
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,9 +42,9 @@ dependencies:
|
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0.9'
|
45
|
-
- - "
|
45
|
+
- - ">"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.8.5
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: pry
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,16 +77,16 @@ dependencies:
|
|
77
77
|
name: rake
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '11.0'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "<"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '11.0'
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
91
|
name: rspec
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: 1.3.6
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project: vagrant-google
|
224
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.5.1
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Vagrant provider plugin for Google Compute Engine.
|