Module: GClouder::Resources::Compute::ProjectInfo::SSHKeys
Defined Under Namespace
Modules: Local, Remote
Class Method Summary
collapse
cli_args, #cli_args, included, load, valid_resources
load, #project, project
Methods included from Helpers
#hash_to_args, included, #module_exists?, #to_arg, #to_deep_merge_hash, #valid_json?
Methods included from Logging
#add, #bad, #change, #debug, #error, #fatal, #good, included, #info, log, loggers, #remove, report, #resource_state, setup, #warn, #warning
Class Method Details
.check ⇒ Object
21
22
|
# File 'lib/gclouder/resources/compute/project_info/ssh_keys.rb', line 21
def self.check
end
|
.clean ⇒ Object
16
17
18
19
|
# File 'lib/gclouder/resources/compute/project_info/ssh_keys.rb', line 16
def self.clean
return unless project.key?("users")
:clean
end
|
.ensure ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/gclouder/resources/compute/project_info/ssh_keys.rb', line 30
def self.ensure
return unless project.key?("users")
:ensure
info "global", heading: true, indent: 2
info
Local.data.each do |user_data|
description = user_data[:description]
user = Remote.data.find { |entry| entry[:description] == description }
if user.nil?
add description
next
end
if user_data[:key] != user[:key]
change description
next
end
good description
end
Remote.data.each do |user_data|
description = user_data[:description]
next if Local.data.find { |entry| entry[:description] == description }
remove description, indent: 3
end
return if Local.list == Remote.list
return if cli_args[:dry_run]
Key.ensure(Local.list)
end
|
12
13
14
|
# File 'lib/gclouder/resources/compute/project_info/ssh_keys.rb', line 12
def self.(stage = :ensure)
info "[#{stage}] compute / metadata / ssh_keys", title: true
end
|
.validate ⇒ Object
24
25
26
27
28
|
# File 'lib/gclouder/resources/compute/project_info/ssh_keys.rb', line 24
def self.validate
return if Local.data.empty?
:validate
Local.validate
end
|