Class: Pec::Handler::Keypair
- Inherits:
-
Object
- Object
- Pec::Handler::Keypair
show all
- Extended by:
- Core
- Defined in:
- lib/pec/handler/keypair.rb
Instance Attribute Summary
Attributes included from Core
#kind
Class Method Summary
collapse
Methods included from Core
build, post_build, recover
Class Method Details
.build(host) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/pec/handler/keypair.rb', line 6
def self.build(host)
return({}) unless host.keypair
Pec::Logger.notice "keypair is #{host.keypair}"
keypair = Yao::Keypair.list.find {|k| k.name == host.keypair }
if keypair
{
key_name: keypair.name,
}
else
raise Pec::ConfigError, "keypair name=#{host.keypair} does not exist"
end
end
|