Class: Formatron::Chef::Keys
- Inherits:
-
Object
- Object
- Formatron::Chef::Keys
- Defined in:
- lib/formatron/chef/keys.rb
Overview
Download the Chef Server keys
Instance Method Summary collapse
- #ec2_key ⇒ Object
-
#init ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(directory:, aws:, bucket:, name:, target:, guid:, ec2_key:) ⇒ Keys
constructor
rubocop:disable Metrics/ParameterLists.
- #organization_key ⇒ Object
- #user_key ⇒ Object
Constructor Details
#initialize(directory:, aws:, bucket:, name:, target:, guid:, ec2_key:) ⇒ Keys
rubocop:disable Metrics/ParameterLists
8 9 10 11 12 13 14 15 16 |
# File 'lib/formatron/chef/keys.rb', line 8 def initialize(directory:, aws:, bucket:, name:, target:, guid:, ec2_key:) @aws = aws @bucket = bucket @name = name @target = target @guid = guid @ec2_key = ec2_key @directory = directory end |
Instance Method Details
#ec2_key ⇒ Object
42 43 44 |
# File 'lib/formatron/chef/keys.rb', line 42 def ec2_key File.join @directory, 'ec2_key' end |
#init ⇒ Object
rubocop:enable Metrics/ParameterLists
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/formatron/chef/keys.rb', line 19 def init S3::ChefServerKeys.get( aws: @aws, bucket: @bucket, name: @name, target: @target, guid: @guid, directory: @directory ) File.write ec2_key, @ec2_key File.chmod 0600, ec2_key end |
#organization_key ⇒ Object
36 37 38 39 40 |
# File 'lib/formatron/chef/keys.rb', line 36 def organization_key S3::ChefServerKeys.organization_pem_path( directory: @directory ) end |
#user_key ⇒ Object
32 33 34 |
# File 'lib/formatron/chef/keys.rb', line 32 def user_key S3::ChefServerKeys.user_pem_path directory: @directory end |