beaker-google 0.4.0 → 0.5.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 +50 -9
- data/Gemfile +3 -4
- data/README.md +1 -1
- data/Rakefile +14 -0
- data/lib/beaker/hypervisor/google_compute.rb +34 -14
- data/lib/beaker-google/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb3fa4774173d47c9f9eab0d0baf8722992adf1dc7be42ff4b8c3baec9b50af8
|
4
|
+
data.tar.gz: 44736e2b7a571deea64abf5ac9b01f48d53a5b75e2c53877e2aad692f0b60ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9cd4293ee5991b4764c5c24daf6ecc69e00e7e5da5badcb2fd9e23acc5c8d463bc5f4cc114787637295f24e6a76f9e9a39c0a3c4396a3184a7b1d12edcf43c2
|
7
|
+
data.tar.gz: 77aef9dfd6dbc5c9a4d360d4e9447b56b499abf5c0a0ff2b3019af853452f3cbe9be99ce50f6cbfdc39fad9b7ddd27132e593bfd993ed8fc98d4bedebe6f077f
|
data/CHANGELOG.md
CHANGED
@@ -1,18 +1,59 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
## [0.5.0](https://github.com/voxpupuli/beaker-google/tree/0.5.0) (2022-10-04)
|
4
4
|
|
5
|
-
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-google/compare/0.4.0...0.5.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Also enable SSH on images from the windows-sql-cloud project [\#27](https://github.com/voxpupuli/beaker-google/pull/27) ([jaevans](https://github.com/jaevans))
|
10
|
+
- Add the OpenSSH directory to the system path [\#25](https://github.com/voxpupuli/beaker-google/pull/25) ([jaevans](https://github.com/jaevans))
|
11
|
+
- Enable windows support [\#23](https://github.com/voxpupuli/beaker-google/pull/23) ([jaevans](https://github.com/jaevans))
|
12
|
+
|
13
|
+
## [0.4.0](https://github.com/voxpupuli/beaker-google/tree/0.4.0) (2022-09-16)
|
6
14
|
|
7
15
|
[Full Changelog](https://github.com/voxpupuli/beaker-google/compare/0.3.0...0.4.0)
|
8
16
|
|
9
|
-
**
|
17
|
+
**Merged pull requests:**
|
18
|
+
|
19
|
+
- Update rake requirement from ~\> 10.1 to ~\> 13.0 [\#20](https://github.com/voxpupuli/beaker-google/pull/20) ([dependabot[bot]](https://github.com/apps/dependabot))
|
20
|
+
- Transfer to Vox Pupuli Prep [\#19](https://github.com/voxpupuli/beaker-google/pull/19) ([yachub](https://github.com/yachub))
|
21
|
+
- Support updated google APIs [\#17](https://github.com/voxpupuli/beaker-google/pull/17) ([jaevans](https://github.com/jaevans))
|
22
|
+
- Update fakefs requirement from ~\> 0.6 to ~\> 1.8 [\#16](https://github.com/voxpupuli/beaker-google/pull/16) ([dependabot[bot]](https://github.com/apps/dependabot))
|
23
|
+
|
24
|
+
## [0.3.0](https://github.com/voxpupuli/beaker-google/tree/0.3.0) (2022-09-08)
|
25
|
+
|
26
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-google/compare/0.2.1...0.3.0)
|
27
|
+
|
28
|
+
**Merged pull requests:**
|
29
|
+
|
30
|
+
- \(RE-14811\) Add RE as codeowners [\#18](https://github.com/voxpupuli/beaker-google/pull/18) ([yachub](https://github.com/yachub))
|
31
|
+
- \(DIO-3133\) Scan repo with Snyk [\#13](https://github.com/voxpupuli/beaker-google/pull/13) ([suckatrash](https://github.com/suckatrash))
|
32
|
+
- Add Dependabot to keep thins up to date [\#8](https://github.com/voxpupuli/beaker-google/pull/8) ([genebean](https://github.com/genebean))
|
33
|
+
|
34
|
+
## [0.2.1](https://github.com/voxpupuli/beaker-google/tree/0.2.1) (2020-01-29)
|
35
|
+
|
36
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-google/compare/0.2.0...0.2.1)
|
37
|
+
|
38
|
+
**Merged pull requests:**
|
39
|
+
|
40
|
+
- \(MAINT\) update beaker testing version [\#7](https://github.com/voxpupuli/beaker-google/pull/7) ([kevpl](https://github.com/kevpl))
|
41
|
+
- \(MAINT\) remove markdown requirement [\#6](https://github.com/voxpupuli/beaker-google/pull/6) ([kevpl](https://github.com/kevpl))
|
42
|
+
- Update google-api-client dependency [\#5](https://github.com/voxpupuli/beaker-google/pull/5) ([cdenneen](https://github.com/cdenneen))
|
43
|
+
|
44
|
+
## [0.2.0](https://github.com/voxpupuli/beaker-google/tree/0.2.0) (2018-09-17)
|
45
|
+
|
46
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-google/compare/0.1.0...0.2.0)
|
47
|
+
|
48
|
+
**Merged pull requests:**
|
49
|
+
|
50
|
+
- \(BKR-1509\) Hypervisor usage instructions for Beaker 4..0 [\#4](https://github.com/voxpupuli/beaker-google/pull/4) ([Dakta](https://github.com/Dakta))
|
51
|
+
- \(MAINT\) Overall GCE Updates [\#3](https://github.com/voxpupuli/beaker-google/pull/3) ([trevor-vaughan](https://github.com/trevor-vaughan))
|
52
|
+
|
53
|
+
## [0.1.0](https://github.com/voxpupuli/beaker-google/tree/0.1.0) (2017-07-19)
|
54
|
+
|
55
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-google/compare/34ca3d6b58dd87455316e055214367215fdff71f...0.1.0)
|
10
56
|
|
11
|
-
- Migrated from the deprecated `google-api-client` to the more modern `google-apis-compute`
|
12
57
|
|
13
|
-
**Breaking changes:**
|
14
58
|
|
15
|
-
|
16
|
-
unexpected results
|
17
|
-
- Users will now need to clean up artifacts from unexpected job termination manually instead of including this method
|
18
|
-
into their test code
|
59
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
CHANGED
@@ -18,7 +18,6 @@ group :acceptance_testing do
|
|
18
18
|
gem 'beaker', *location_for(ENV.fetch('BEAKER_VERSION', '~> 4.0'))
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# end
|
21
|
+
group :release do
|
22
|
+
gem 'github_changelog_generator', require: false
|
23
|
+
end
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ The behavior of this library can be configured using either the beaker host conf
|
|
45
45
|
| gce_project | true | | The ID of the Google GCP project to host resources. |
|
46
46
|
| gce_zone | true | | The zone to place compute instances in. The region is calculated from the zone name. |
|
47
47
|
| gce_network | false | Default | The name of the network to attach to instances. If the project uses the default network, this and `gce_subnetwork` can be left empty. |
|
48
|
-
| gce_subnetwork | false | Default |
|
48
|
+
| gce_subnetwork | false | Default | The name of the subnetwork to attach to the instances network interface. If the Default network is not used, this must be supplied. |
|
49
49
|
| gce_ssh_private_key | false | $HOME/.ssh/google_compute_engine | The file path of the private key to use to connect to instances. If using the key created by the gcloud tool, this can be left blank. |
|
50
50
|
| gce_ssh_public_key | false | <gce_ssh_private_key>.pub | The file path of the public key to upload to the instance. If left blank, attempt to use the file at `gce_ssh_private_key` with a `.pub` extension. |
|
51
51
|
| gce_machine_type | false | e2-standard-4 | The machine type to use for the instance. If the `BEAKER_gce_machine_type` environment variable is set, it will be used for all hosts. |
|
data/Rakefile
CHANGED
@@ -101,3 +101,17 @@ namespace :docs do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
end
|
104
|
+
|
105
|
+
begin
|
106
|
+
require 'rubygems'
|
107
|
+
require 'github_changelog_generator/task'
|
108
|
+
rescue LoadError
|
109
|
+
else
|
110
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
111
|
+
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
|
112
|
+
config.user = 'voxpupuli'
|
113
|
+
config.project = 'beaker-google'
|
114
|
+
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
|
115
|
+
config.future_release = gem_version
|
116
|
+
end
|
117
|
+
end
|
@@ -162,13 +162,20 @@ module Beaker
|
|
162
162
|
@logger.debug("Created Google Compute instance for #{host.name}: #{host['vmhostname']}")
|
163
163
|
instance = @gce_helper.get_instance(host['vmhostname'])
|
164
164
|
|
165
|
+
# Make sure we have a non root/Adminsitor user to log in as
|
166
|
+
if host['user'] == "root" || host['user'] == "Administrator" || host['user'].empty?
|
167
|
+
initial_user = 'google_compute'
|
168
|
+
else
|
169
|
+
initial_user = host['user']
|
170
|
+
end
|
171
|
+
|
165
172
|
# add metadata to instance, if there is any to set
|
166
173
|
# mdata = format_metadata
|
167
174
|
# TODO: Set a configuration option for this to allow disabeling oslogin
|
168
175
|
mdata = [
|
169
176
|
{
|
170
177
|
key: 'ssh-keys',
|
171
|
-
value: "
|
178
|
+
value: "#{initial_user}:#{File.read(find_google_ssh_public_key).strip}"
|
172
179
|
},
|
173
180
|
# For now oslogin needs to be disabled as there's no way to log in as root and it would
|
174
181
|
# take too much work on beaker to add sudo support to everything
|
@@ -177,10 +184,29 @@ module Beaker
|
|
177
184
|
value: 'FALSE'
|
178
185
|
},
|
179
186
|
]
|
180
|
-
|
181
|
-
#
|
182
|
-
|
183
|
-
|
187
|
+
|
188
|
+
# Check for google's default windows images and turn on ssh if found
|
189
|
+
if image_project == "windows-cloud" || image_project == "windows-sql-cloud"
|
190
|
+
# Turn on SSH on GCP's default windows images
|
191
|
+
mdata << {
|
192
|
+
key: 'enable-windows-ssh',
|
193
|
+
value: 'TRUE',
|
194
|
+
}
|
195
|
+
mdata << {
|
196
|
+
key: 'sysprep-specialize-script-cmd',
|
197
|
+
value: 'googet -noconfirm=true update && googet -noconfirm=true install google-compute-engine-ssh',
|
198
|
+
}
|
199
|
+
# Some versions of windows don't seem to add the OpenSSH directory to the path which prevents scp from working
|
200
|
+
mdata << {
|
201
|
+
key: 'sysprep-specialize-script-ps1',
|
202
|
+
value: '[Environment]::SetEnvironmentVariable( "PATH", "$ENV:PATH;C:\Program Files\OpenSSH", [EnvironmentVariableTarget]::Machine )',
|
203
|
+
}
|
204
|
+
end
|
205
|
+
unless mdata.empty?
|
206
|
+
# Add the metadata to the host
|
207
|
+
@gce_helper.set_metadata_on_instance(host['vmhostname'], mdata)
|
208
|
+
@logger.debug("Added tags to Google Compute instance #{host.name}: #{host['vmhostname']}")
|
209
|
+
end
|
184
210
|
|
185
211
|
host['ip'] = instance.network_interfaces[0].access_configs[0].nat_ip
|
186
212
|
|
@@ -190,20 +216,14 @@ module Beaker
|
|
190
216
|
if host['disable_root_ssh'] == true
|
191
217
|
@logger.info('Not enabling root ssh as disable_root_ssh is true')
|
192
218
|
else
|
193
|
-
|
194
|
-
|
195
|
-
default_user = host['user']
|
196
|
-
|
197
|
-
# TODO: Pull this out into a configuration option or something
|
198
|
-
host['user'] = 'google_compute'
|
199
|
-
|
219
|
+
real_user = host['user']
|
220
|
+
host['user'] = initial_user
|
200
221
|
# Set the ssh private key we need to use
|
201
222
|
host.options['ssh']['keys'] = [find_google_ssh_private_key]
|
202
223
|
|
203
224
|
copy_ssh_to_root(host, @options)
|
204
225
|
enable_root_login(host, @options)
|
205
|
-
host['user'] =
|
206
|
-
|
226
|
+
host['user'] = real_user
|
207
227
|
# shut down connection, will reconnect on next exec
|
208
228
|
host.close
|
209
229
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|