vagrant-google 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +28 -6
- data/Gemfile +4 -1
- data/README.md +1 -6
- data/lib/vagrant-google/action/connect_google.rb +0 -8
- data/lib/vagrant-google/action/run_instance.rb +3 -0
- data/lib/vagrant-google/config.rb +9 -7
- data/lib/vagrant-google/version.rb +1 -1
- data/tasks/acceptance.rake +0 -5
- data/test/unit/common/config_test.rb +0 -4
- data/vagrantfile_examples/Vagrantfile.multiple_machines +0 -3
- data/vagrantfile_examples/Vagrantfile.provision_single +0 -2
- data/vagrantfile_examples/Vagrantfile.simple +0 -1
- data/vagrantfile_examples/Vagrantfile.zone_config +0 -1
- 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: ed6ee3d8610c741c80fb0a023922309c396ba06f
|
4
|
+
data.tar.gz: e5110f3de87fad8d872150e38e371f560e65993c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa68543e38fa5432182179df747283e5182fd303edca1dae9f1c3581805182c4d46711d438a13c2d68e090774b10eae95e544ad181e9d29e793d448dcb8e17d
|
7
|
+
data.tar.gz: 4c8e2dac09fa2c02ee3dba1f9cc9e74ca4c89488d85221e6d682ebb5044711f303c5031eff61c2e74506c2316d7bbfbbfebbe797758a78ba75ea9e6a3f36b94f
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,28 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
4
4
|
|
5
|
+
## 2.5.0 (September 2019)
|
6
|
+
|
7
|
+
### User-facing
|
8
|
+
|
9
|
+
#### Added
|
10
|
+
- \#222 Added internal IP support [andrewh1978]
|
11
|
+
|
12
|
+
#### Deprecated
|
13
|
+
|
14
|
+
- \#220 Deprecated google_client_email parameter, as it's no longer needed or
|
15
|
+
supported by fog-google [temikus]
|
16
|
+
|
17
|
+
### Development
|
18
|
+
|
19
|
+
#### Added
|
20
|
+
|
21
|
+
- \#223 Set up unit test GitHub Action worflow [temikus]
|
22
|
+
|
23
|
+
#### Fixed
|
24
|
+
|
25
|
+
- \#225 Locked the vagrant dep to 2.2.4 due to bundler issues on 2.2.5 [temikus]
|
26
|
+
|
5
27
|
## 2.4.0 (April 2019)
|
6
28
|
|
7
29
|
### User-facing
|
@@ -11,7 +33,7 @@ The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1
|
|
11
33
|
|
12
34
|
#### Fixed
|
13
35
|
- \#214 Set a default zone only if `default` network is used [mavin]
|
14
|
-
- \#215 Allow tags,labels and additional_disks to be merged with multiple
|
36
|
+
- \#215 Allow tags,labels and additional_disks to be merged with multiple
|
15
37
|
configs [mavin]
|
16
38
|
|
17
39
|
### Development
|
@@ -33,14 +55,14 @@ The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1
|
|
33
55
|
|
34
56
|
### User-facing
|
35
57
|
|
36
|
-
- \#206 Fix image selection logic - Plugin no longer traces back with
|
58
|
+
- \#206 Fix image selection logic - Plugin no longer traces back with
|
37
59
|
`image_family` config option. [temikus]
|
38
60
|
|
39
61
|
### Development
|
40
62
|
|
41
63
|
- \#206 Bumped dependencies. [temikus]
|
42
|
-
- fog-google version to 1.8.1
|
43
|
-
- vagrant & vagrant-spec are now pointing to new upstream Hashicorp org repos
|
64
|
+
- fog-google version to 1.8.1
|
65
|
+
- vagrant & vagrant-spec are now pointing to new upstream Hashicorp org repos
|
44
66
|
|
45
67
|
## 2.2.0 (June 2018)
|
46
68
|
|
@@ -59,13 +81,13 @@ platforms.
|
|
59
81
|
## 2.0.0 (March 2018)
|
60
82
|
|
61
83
|
* Update to use fog-google gem v1
|
62
|
-
* Add new configuration option `labels` for setting [labels](https://cloud.google.com/compute/docs/labeling-resources)
|
84
|
+
* Add new configuration option `labels` for setting [labels](https://cloud.google.com/compute/docs/labeling-resources)
|
63
85
|
on GCE instances
|
64
86
|
* Fix disk cleanup issue causing the disk to be marked as created before insertion
|
65
87
|
* Test environment fixups to avoid 'Encoded files can't be read outside of the Vagrant installer.'
|
66
88
|
* Breaking changes:
|
67
89
|
* Drop support for configuration option `google_key_location`(GCP P12 key)
|
68
|
-
* `image` parameter no longer defaults to an arbitrary image and must be
|
90
|
+
* `image` parameter no longer defaults to an arbitrary image and must be
|
69
91
|
specified at runtime
|
70
92
|
* Rsync behavior now consistent with Vagrant's default, removed old rsync code
|
71
93
|
|
data/Gemfile
CHANGED
@@ -23,6 +23,9 @@ group :development do
|
|
23
23
|
# We depend on Vagrant for development, but we don't add it as a
|
24
24
|
# gem dependency because we expect to be installed within the
|
25
25
|
# Vagrant environment itself using `vagrant plugin`.
|
26
|
-
|
26
|
+
|
27
|
+
# TODO(temikus): remove to 2.2.4 tag lock when
|
28
|
+
# https://github.com/hashicorp/vagrant/pull/10945 is resolved
|
29
|
+
gem 'vagrant', git: "https://github.com/hashicorp/vagrant.git", :tag => 'v2.2.4'
|
27
30
|
gem 'vagrant-spec', git: "https://github.com/hashicorp/vagrant-spec.git"
|
28
31
|
end
|
data/README.md
CHANGED
@@ -85,7 +85,6 @@ Vagrant.configure("2") do |config|
|
|
85
85
|
|
86
86
|
config.vm.provider :google do |google, override|
|
87
87
|
google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
88
|
-
google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
89
88
|
google.google_json_key_location = "/path/to/your/private-key.json"
|
90
89
|
|
91
90
|
google.image_family = 'ubuntu-1604-lts'
|
@@ -165,8 +164,6 @@ configuration for this provider.
|
|
165
164
|
|
166
165
|
This provider exposes quite a few provider-specific configuration options:
|
167
166
|
|
168
|
-
* `google_client_email` - The Client Email address for your Service Account.
|
169
|
-
(Can also be configured with `GOOGLE_CLIENT_EMAIL` environment variable.)
|
170
167
|
* `google_json_key_location` - The location of the JSON private key file matching your
|
171
168
|
Service Account.
|
172
169
|
(Can also be configured with `GOOGLE_JSON_KEY_LOCATION` environment variable.)
|
@@ -198,6 +195,7 @@ will pull the most recent CentOS 7 image. For more info, refer to
|
|
198
195
|
* `zone` - The zone name where the instance will be created.
|
199
196
|
* `can_ip_forward` - Boolean whether to enable IP Forwarding.
|
200
197
|
* `external_ip` - The external IP address to use (supports names). Set to `false` to not assign an external address.
|
198
|
+
* `network_ip` - The internal IP address to use. Default is to use next available address.
|
201
199
|
* `use_private_ip` - Boolean whether to use private IP for SSH/provisioning. Default is false.
|
202
200
|
* `preemptible` - Boolean whether to enable preemptibility. Default is false.
|
203
201
|
* `auto_restart` - Boolean whether to enable auto_restart. Default is true.
|
@@ -231,7 +229,6 @@ Vagrant.configure("2") do |config|
|
|
231
229
|
|
232
230
|
config.vm.provider :google do |google|
|
233
231
|
google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
234
|
-
google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
235
232
|
google.google_json_key_location = "/path/to/your/private-key.json"
|
236
233
|
end
|
237
234
|
end
|
@@ -249,7 +246,6 @@ Vagrant.configure("2") do |config|
|
|
249
246
|
|
250
247
|
config.vm.provider :google do |google|
|
251
248
|
google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
252
|
-
google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
253
249
|
google.google_json_key_location = "/path/to/your/private-key.json"
|
254
250
|
|
255
251
|
# Make sure to set this to trigger the zone_config
|
@@ -320,7 +316,6 @@ Before you start acceptance tests, you'll need to set the authentication
|
|
320
316
|
shell variables accordingly:
|
321
317
|
|
322
318
|
```sh
|
323
|
-
export GOOGLE_CLIENT_EMAIL="your-google_service_account_email@developer.gserviceaccount.com"
|
324
319
|
export GOOGLE_PROJECT_ID="your-google-cloud-project-id"
|
325
320
|
export GOOGLE_JSON_KEY_LOCATION="/full/path/to/your/private-key.json"
|
326
321
|
|
@@ -36,18 +36,10 @@ module VagrantPlugins
|
|
36
36
|
:google_project => provider_config.google_project_id,
|
37
37
|
}
|
38
38
|
|
39
|
-
unless provider_config.google_client_email.nil?
|
40
|
-
fog_config[:google_client_email] = provider_config.google_client_email
|
41
|
-
end
|
42
|
-
|
43
39
|
unless provider_config.google_json_key_location.nil?
|
44
40
|
fog_config[:google_json_key_location] = find_key(provider_config.google_json_key_location, env)
|
45
41
|
end
|
46
42
|
|
47
|
-
if provider_config.google_client_email.nil? and provider_config.google_json_key_location.nil?
|
48
|
-
fog_config[:google_application_default] = true
|
49
|
-
end
|
50
|
-
|
51
43
|
@logger.info("Creating Google API client and adding to Vagrant environment")
|
52
44
|
env[:google_compute] = Fog::Compute.new(fog_config)
|
53
45
|
@app.call(env)
|
@@ -60,6 +60,7 @@ module VagrantPlugins
|
|
60
60
|
can_ip_forward = zone_config.can_ip_forward
|
61
61
|
use_private_ip = zone_config.use_private_ip
|
62
62
|
external_ip = zone_config.external_ip
|
63
|
+
network_ip = zone_config.network_ip
|
63
64
|
preemptible = zone_config.preemptible
|
64
65
|
auto_restart = zone_config.auto_restart
|
65
66
|
on_host_maintenance = zone_config.on_host_maintenance
|
@@ -91,6 +92,7 @@ module VagrantPlugins
|
|
91
92
|
env[:ui].info(" -- IP Forward: #{can_ip_forward}")
|
92
93
|
env[:ui].info(" -- Use private IP: #{use_private_ip}")
|
93
94
|
env[:ui].info(" -- External IP: #{external_ip}")
|
95
|
+
env[:ui].info(" -- Network IP: #{network_ip}")
|
94
96
|
env[:ui].info(" -- Preemptible: #{preemptible}")
|
95
97
|
env[:ui].info(" -- Auto Restart: #{auto_restart}")
|
96
98
|
env[:ui].info(" -- On Maintenance: #{on_host_maintenance}")
|
@@ -254,6 +256,7 @@ module VagrantPlugins
|
|
254
256
|
:can_ip_forward => can_ip_forward,
|
255
257
|
:use_private_ip => use_private_ip,
|
256
258
|
:external_ip => external_ip,
|
259
|
+
:network_ip => network_ip,
|
257
260
|
:disks => disks,
|
258
261
|
:scheduling => scheduling,
|
259
262
|
:service_accounts => service_accounts
|
@@ -17,11 +17,6 @@ require "securerandom"
|
|
17
17
|
module VagrantPlugins
|
18
18
|
module Google
|
19
19
|
class Config < Vagrant.plugin("2", :config) # rubocop:disable Metrics/ClassLength
|
20
|
-
# The Service Account Client ID Email address
|
21
|
-
#
|
22
|
-
# @return [String]
|
23
|
-
attr_accessor :google_client_email
|
24
|
-
|
25
20
|
# The path to the Service Account json-formatted private key
|
26
21
|
#
|
27
22
|
# @return [String]
|
@@ -117,6 +112,11 @@ module VagrantPlugins
|
|
117
112
|
# @return String
|
118
113
|
attr_accessor :external_ip
|
119
114
|
|
115
|
+
# The network IP Address to use
|
116
|
+
#
|
117
|
+
# @return String
|
118
|
+
attr_accessor :network_ip
|
119
|
+
|
120
120
|
# Use private ip address
|
121
121
|
#
|
122
122
|
# @return Boolean
|
@@ -179,7 +179,6 @@ module VagrantPlugins
|
|
179
179
|
attr_accessor :additional_disks
|
180
180
|
|
181
181
|
def initialize(zone_specific=false)
|
182
|
-
@google_client_email = UNSET_VALUE
|
183
182
|
@google_json_key_location = UNSET_VALUE
|
184
183
|
@google_project_id = UNSET_VALUE
|
185
184
|
@image = UNSET_VALUE
|
@@ -199,6 +198,7 @@ module VagrantPlugins
|
|
199
198
|
@labels = {}
|
200
199
|
@can_ip_forward = UNSET_VALUE
|
201
200
|
@external_ip = UNSET_VALUE
|
201
|
+
@network_ip = UNSET_VALUE
|
202
202
|
@use_private_ip = UNSET_VALUE
|
203
203
|
@autodelete_disk = UNSET_VALUE
|
204
204
|
@preemptible = UNSET_VALUE
|
@@ -295,7 +295,6 @@ module VagrantPlugins
|
|
295
295
|
def finalize! # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
296
296
|
# Try to get access keys from standard Google environment variables; they
|
297
297
|
# will default to nil if the environment variables are not present.
|
298
|
-
@google_client_email = ENV['GOOGLE_CLIENT_EMAIL'] if @google_client_email == UNSET_VALUE
|
299
298
|
@google_json_key_location = ENV['GOOGLE_JSON_KEY_LOCATION'] if @google_json_key_location == UNSET_VALUE
|
300
299
|
@google_project_id = ENV['GOOGLE_PROJECT_ID'] if @google_project_id == UNSET_VALUE
|
301
300
|
|
@@ -356,6 +355,9 @@ module VagrantPlugins
|
|
356
355
|
# external_ip defaults to nil
|
357
356
|
@external_ip = nil if @external_ip == UNSET_VALUE
|
358
357
|
|
358
|
+
# network_ip defaults to nil
|
359
|
+
@network_ip = nil if @network_ip == UNSET_VALUE
|
360
|
+
|
359
361
|
# use_private_ip defaults to false
|
360
362
|
@use_private_ip = false if @use_private_ip == UNSET_VALUE
|
361
363
|
|
data/tasks/acceptance.rake
CHANGED
@@ -37,10 +37,6 @@ namespace :acceptance do
|
|
37
37
|
abort "Environment variable GOOGLE_PROJECT_ID is not set. Aborting."
|
38
38
|
end
|
39
39
|
|
40
|
-
unless ENV["GOOGLE_CLIENT_EMAIL"]
|
41
|
-
abort "Environment variable GOOGLE_CLIENT_EMAIL is not set. Aborting."
|
42
|
-
end
|
43
|
-
|
44
40
|
unless ENV["GOOGLE_SSH_USER"]
|
45
41
|
yellow "WARNING: GOOGLE_SSH_USER variable is not set. Will try to start tests using insecure Vagrant private key."
|
46
42
|
end
|
@@ -70,7 +66,6 @@ namespace :acceptance do
|
|
70
66
|
image_family
|
71
67
|
synced_folder/rsync
|
72
68
|
provisioner/shell
|
73
|
-
provisioner/chef-solo
|
74
69
|
).map{ |s| "provider/google/#{s}" }
|
75
70
|
|
76
71
|
command = "vagrant-spec test --components=#{components.join(" ")}"
|
@@ -99,13 +99,11 @@ describe VagrantPlugins::Google::Config do
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
its("google_client_email") { should be_nil }
|
103
102
|
its("google_json_key_location") { should be_nil }
|
104
103
|
end
|
105
104
|
|
106
105
|
context "with Google credential environment variables" do
|
107
106
|
before :each do
|
108
|
-
allow(ENV).to receive(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
|
109
107
|
allow(ENV).to receive(:[]).with("GOOGLE_JSON_KEY_LOCATION").and_return("/path/to/json/key")
|
110
108
|
end
|
111
109
|
|
@@ -115,7 +113,6 @@ describe VagrantPlugins::Google::Config do
|
|
115
113
|
end
|
116
114
|
end
|
117
115
|
|
118
|
-
its("google_client_email") { should == "client_id_email" }
|
119
116
|
its("google_json_key_location") { should == "/path/to/json/key" }
|
120
117
|
end
|
121
118
|
end
|
@@ -297,7 +294,6 @@ describe VagrantPlugins::Google::Config do
|
|
297
294
|
|
298
295
|
before :each do
|
299
296
|
# Stub out required env to make sure we produce only errors we're looking for.
|
300
|
-
allow(ENV).to receive(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
|
301
297
|
allow(ENV).to receive(:[]).with("GOOGLE_PROJECT_ID").and_return("my-awesome-project")
|
302
298
|
allow(ENV).to receive(:[]).with("GOOGLE_JSON_KEY_LOCATION").and_return("/path/to/json/key")
|
303
299
|
allow(ENV).to receive(:[]).with("GOOGLE_SSH_KEY_LOCATION").and_return("/path/to/ssh/key")
|
@@ -24,7 +24,6 @@
|
|
24
24
|
|
25
25
|
# Customize these global variables
|
26
26
|
$GOOGLE_PROJECT_ID = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
27
|
-
$GOOGLE_CLIENT_EMAIL = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
28
27
|
$GOOGLE_JSON_KEY_LOCATION = "/path/to/your/private-key.json"
|
29
28
|
$LOCAL_USER = "mitchellh"
|
30
29
|
$LOCAL_SSH_KEY = "~/.ssh/id_rsa"
|
@@ -54,7 +53,6 @@ Vagrant.configure("2") do |config|
|
|
54
53
|
config.vm.define :z1c do |z1c|
|
55
54
|
z1c.vm.provider :google do |google, override|
|
56
55
|
google.google_project_id = $GOOGLE_PROJECT_ID
|
57
|
-
google.google_client_email = $GOOGLE_CLIENT_EMAIL
|
58
56
|
google.google_json_key_location = $GOOGLE_JSON_KEY_LOCATION
|
59
57
|
google.zone = "us-central1-c"
|
60
58
|
|
@@ -74,7 +72,6 @@ Vagrant.configure("2") do |config|
|
|
74
72
|
config.vm.define :z1f do |z1f|
|
75
73
|
z1f.vm.provider :google do |google, override|
|
76
74
|
google.google_project_id = $GOOGLE_PROJECT_ID
|
77
|
-
google.google_client_email = $GOOGLE_CLIENT_EMAIL
|
78
75
|
google.google_json_key_location = $GOOGLE_JSON_KEY_LOCATION
|
79
76
|
google.zone = "us-central1-f"
|
80
77
|
|
@@ -20,7 +20,6 @@
|
|
20
20
|
|
21
21
|
# Customize these global variables
|
22
22
|
$GOOGLE_PROJECT_ID = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
23
|
-
$GOOGLE_CLIENT_EMAIL = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
24
23
|
$GOOGLE_JSON_KEY_LOCATION = "/path/to/your/private-key.json"
|
25
24
|
$LOCAL_USER = "mitchellh"
|
26
25
|
$LOCAL_SSH_KEY = "~/.ssh/id_rsa"
|
@@ -31,7 +30,6 @@ Vagrant.configure("2") do |config|
|
|
31
30
|
|
32
31
|
config.vm.provider :google do |google, override|
|
33
32
|
google.google_project_id = $GOOGLE_PROJECT_ID
|
34
|
-
google.google_client_email = $GOOGLE_CLIENT_EMAIL
|
35
33
|
google.google_json_key_location = $GOOGLE_JSON_KEY_LOCATION
|
36
34
|
|
37
35
|
# Override provider defaults
|
@@ -19,7 +19,6 @@ Vagrant.configure("2") do |config|
|
|
19
19
|
|
20
20
|
config.vm.provider :google do |google, override|
|
21
21
|
google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
22
|
-
google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
23
22
|
google.google_json_key_location = "/path/to/your/private-key.json"
|
24
23
|
|
25
24
|
google.image_family = 'ubuntu-1604-lts'
|
@@ -19,7 +19,6 @@ Vagrant.configure("2") do |config|
|
|
19
19
|
|
20
20
|
config.vm.provider :google do |google, override|
|
21
21
|
google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
|
22
|
-
google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
|
23
22
|
google.google_json_key_location = "/path/to/your/private-key.json"
|
24
23
|
|
25
24
|
override.ssh.username = "mitchellh"
|
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: 2.
|
4
|
+
version: 2.5.0
|
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: 2019-
|
12
|
+
date: 2019-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog-google
|