Class: Dependencies::Sshkey

Inherits:
Dependency show all
Defined in:
lib/dependencies/sshkey.rb

Constant Summary collapse

DEFAULT_KEY_SIZE =
2048
DEFAULT_KEY_ALGO =
"rsa"
DEFAULT_KEY_LIFETIME_S =
3600

Constants inherited from Dependency

Dependency::DESCRIPTION_TYPE_WIDTH

Instance Attribute Summary

Attributes inherited from Dependency

#exit_code, #name, #output

Instance Method Summary collapse

Methods inherited from Dependency

#always_act?, #initialize, #success?, #type

Constructor Details

This class inherits a constructor from Dependency

Instance Method Details

#meetObject



18
19
20
21
22
23
24
25
# File 'lib/dependencies/sshkey.rb', line 18

def meet
	Secrets.load

	FileUtils.mkdir_p(dir_name) unless File.directory?(dir_name)

	generate_key unless File.exist?(priv_key_name) && File.exist?(pub_key_name)
	add_key if success? && should_add_key?
end

#met?Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/dependencies/sshkey.rb', line 13

def met?
	# we always need to at least update the key lifetime in the agent
	false
end

#should_meet?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/dependencies/sshkey.rb', line 31

def should_meet?
	true
end

#unmeetObject



27
28
29
# File 'lib/dependencies/sshkey.rb', line 27

def unmeet
	true
end