cloud-mu 2.0.0.pre.alpha5 → 2.0.0.pre.alpha6
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/cloud-mu.gemspec +4 -2
- data/modules/mu/cloud.rb +1 -1
- data/modules/mu/clouds/google/user.rb +3 -3
- data/modules/mu/clouds/google.rb +2 -2
- metadata +36 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c2f8abd519c2f8f9acc75995617db4a1ca00014dae0e222a208acd7ad359b9aa
|
|
4
|
+
data.tar.gz: 5f9c76057263e88e4ea37b11fd83c43c3fe23ad16a5fd342aa5852f14b6cd642
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c82d65f0c5353128cf908b204f565411598808d2560e13d98f4829d9383d16c1d19b96ceb7ea7ee4d33864b84db83579e7db4b32b7ff616facd2725de3636411
|
|
7
|
+
data.tar.gz: d9ebe46385658f90ac3442f89d99d5313057b9922c07efcc177e6f886668e45986783689326bd98997ac55ab664e265e4040026f07a0f135d4b3952d03a4048f
|
data/cloud-mu.gemspec
CHANGED
|
@@ -17,8 +17,8 @@ end
|
|
|
17
17
|
|
|
18
18
|
Gem::Specification.new do |s|
|
|
19
19
|
s.name = 'cloud-mu'
|
|
20
|
-
s.version = '2.0.0-
|
|
21
|
-
s.date = '2019-02-
|
|
20
|
+
s.version = '2.0.0-alpha6'
|
|
21
|
+
s.date = '2019-02-13'
|
|
22
22
|
s.require_paths = ['modules']
|
|
23
23
|
s.required_ruby_version = '>= 2.4'
|
|
24
24
|
s.summary = "The eGTLabs Mu toolkit for unified cloud deployments"
|
|
@@ -54,6 +54,8 @@ EOF
|
|
|
54
54
|
s.add_runtime_dependency 'nokogiri', "~> 1.8"
|
|
55
55
|
s.add_runtime_dependency 'solve', '~> 4.0'
|
|
56
56
|
s.add_runtime_dependency 'net-ldap', "~> 0.16"
|
|
57
|
+
s.add_runtime_dependency 'net-ssh', "~> 4.2"
|
|
58
|
+
s.add_runtime_dependency 'net-ssh-multi', '~> 1.2', '>= 1.2.1'
|
|
57
59
|
s.add_runtime_dependency 'googleauth', "~> 0.6"
|
|
58
60
|
s.add_runtime_dependency 'google-api-client', "~> 0.25"
|
|
59
61
|
s.add_runtime_dependency 'rubocop', '~> 0.58'
|
data/modules/mu/cloud.rb
CHANGED
|
@@ -523,7 +523,7 @@ module MU
|
|
|
523
523
|
begin
|
|
524
524
|
require "mu/clouds/#{cloud.downcase}/#{cfg_name}"
|
|
525
525
|
rescue LoadError => e
|
|
526
|
-
raise MuCloudResourceNotImplemented, "MU::Cloud::#{cloud} does not currently implement #{shortclass}"
|
|
526
|
+
raise MuCloudResourceNotImplemented, "MU::Cloud::#{cloud} does not currently implement #{shortclass}, or implementation does not load correctly (#{e.message})"
|
|
527
527
|
end
|
|
528
528
|
@cloud_class_cache[cloud] = {} if !@cloud_class_cache.has_key?(cloud)
|
|
529
529
|
begin
|
|
@@ -200,13 +200,13 @@ module MU
|
|
|
200
200
|
ok = true
|
|
201
201
|
|
|
202
202
|
# admin_directory only works in a GSuite environment
|
|
203
|
-
if !user['name'].match(/@/i) and
|
|
203
|
+
if !user['name'].match(/@/i) and MU::Cloud::Google.credConfig(user['credentials'])['masquerade_as']
|
|
204
204
|
# XXX flesh this check out, need to test with a GSuite site
|
|
205
205
|
pp MU::Cloud::Google.admin_directory(credentials: user['credentials']).get_user(user['name'])
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
if user['groups'] and user['groups'].size > 0 and
|
|
209
|
-
|
|
209
|
+
!MU::Cloud::Google.credConfig(user['credentials'])['masquerade_as']
|
|
210
210
|
MU.log "Cannot change Google group memberships in non-GSuite environments.\nVisit https://groups.google.com to manage groups.", MU::ERR
|
|
211
211
|
ok = false
|
|
212
212
|
end
|
|
@@ -260,7 +260,7 @@ module MU
|
|
|
260
260
|
req_obj
|
|
261
261
|
)
|
|
262
262
|
rescue ::Google::Apis::ClientError => e
|
|
263
|
-
if e.message.match(/does not exist/i) and
|
|
263
|
+
if e.message.match(/does not exist/i) and !MU::Cloud::Google.credConfig(@config['credentials'])['masquerade_as']
|
|
264
264
|
raise MuError, "User #{@config['name']} does not exist, and we cannot create Google user in non-GSuite environments.\nVisit https://accounts.google.com to create new accounts."
|
|
265
265
|
end
|
|
266
266
|
raise e
|
data/modules/mu/clouds/google.rb
CHANGED
|
@@ -572,9 +572,9 @@ module MU
|
|
|
572
572
|
|
|
573
573
|
if subclass.nil?
|
|
574
574
|
begin
|
|
575
|
-
@@admin_directory_api[credentials] ||= MU::Cloud::Google::Endpoint.new(api: "AdminDirectoryV1::DirectoryService", scopes: ['https://www.googleapis.com/auth/admin.directory.group.member.readonly', 'https://www.googleapis.com/auth/admin.directory.group.readonly', 'https://www.googleapis.com/auth/admin.directory.user.readonly', 'https://www.googleapis.com/auth/admin.directory.domain.readonly', 'https://www.googleapis.com/auth/admin.directory.orgunit.readonly', 'https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly', 'https://www.googleapis.com/auth/admin.directory.customer.readonly'], masquerade:
|
|
575
|
+
@@admin_directory_api[credentials] ||= MU::Cloud::Google::Endpoint.new(api: "AdminDirectoryV1::DirectoryService", scopes: ['https://www.googleapis.com/auth/admin.directory.group.member.readonly', 'https://www.googleapis.com/auth/admin.directory.group.readonly', 'https://www.googleapis.com/auth/admin.directory.user.readonly', 'https://www.googleapis.com/auth/admin.directory.domain.readonly', 'https://www.googleapis.com/auth/admin.directory.orgunit.readonly', 'https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly', 'https://www.googleapis.com/auth/admin.directory.customer.readonly'], masquerade: MU::Cloud::Google.credConfig(credentials)['masquerade_as'], credentials: credentials)
|
|
576
576
|
rescue Signet::AuthorizationError => e
|
|
577
|
-
MU.log "Cannot masquerade as #{
|
|
577
|
+
MU.log "Cannot masquerade as #{MU::Cloud::Google.credConfig(credentials)['masquerade_as']}", MU::ERROR, details: "You can only use masquerade_as with GSuite. For more information on delegating GSuite authority to a service account, see:\nhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority"
|
|
578
578
|
raise e
|
|
579
579
|
end
|
|
580
580
|
return @@admin_directory_api[credentials]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloud-mu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.0.pre.
|
|
4
|
+
version: 2.0.0.pre.alpha6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Stange
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2019-02-
|
|
15
|
+
date: 2019-02-13 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: erubis
|
|
@@ -238,6 +238,40 @@ dependencies:
|
|
|
238
238
|
- - "~>"
|
|
239
239
|
- !ruby/object:Gem::Version
|
|
240
240
|
version: '0.16'
|
|
241
|
+
- !ruby/object:Gem::Dependency
|
|
242
|
+
name: net-ssh
|
|
243
|
+
requirement: !ruby/object:Gem::Requirement
|
|
244
|
+
requirements:
|
|
245
|
+
- - "~>"
|
|
246
|
+
- !ruby/object:Gem::Version
|
|
247
|
+
version: '4.2'
|
|
248
|
+
type: :runtime
|
|
249
|
+
prerelease: false
|
|
250
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
251
|
+
requirements:
|
|
252
|
+
- - "~>"
|
|
253
|
+
- !ruby/object:Gem::Version
|
|
254
|
+
version: '4.2'
|
|
255
|
+
- !ruby/object:Gem::Dependency
|
|
256
|
+
name: net-ssh-multi
|
|
257
|
+
requirement: !ruby/object:Gem::Requirement
|
|
258
|
+
requirements:
|
|
259
|
+
- - "~>"
|
|
260
|
+
- !ruby/object:Gem::Version
|
|
261
|
+
version: '1.2'
|
|
262
|
+
- - ">="
|
|
263
|
+
- !ruby/object:Gem::Version
|
|
264
|
+
version: 1.2.1
|
|
265
|
+
type: :runtime
|
|
266
|
+
prerelease: false
|
|
267
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
268
|
+
requirements:
|
|
269
|
+
- - "~>"
|
|
270
|
+
- !ruby/object:Gem::Version
|
|
271
|
+
version: '1.2'
|
|
272
|
+
- - ">="
|
|
273
|
+
- !ruby/object:Gem::Version
|
|
274
|
+
version: 1.2.1
|
|
241
275
|
- !ruby/object:Gem::Dependency
|
|
242
276
|
name: googleauth
|
|
243
277
|
requirement: !ruby/object:Gem::Requirement
|