knife-ec2 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/knife/ec2_base.rb +4 -7
- data/lib/knife-ec2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f0efb7449ec88881f143653d3bb282ca3d0e4e682773487cd17c4943e6631b9
|
4
|
+
data.tar.gz: c89dfbbbb331f2258af0797273a58e77f13a321d62b17ec58346f07139fb27a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19f0cfcf4ced0fadfc2763cab088c15faa743f932f334fd8ffdd869c011284b32e281576cfaa3195e1a6b4fd97f7cf28bd29f1142b5983e8fba33ad7ed707830
|
7
|
+
data.tar.gz: ba73cea8ba3d9baed0553ed7dca881e3b4756b8324015a99672937e0cbb7ba4dc0c00412200ffb21db61a15ec1090dbc5b9d1d9d49a197289c9dfcaef58585ba
|
data/lib/chef/knife/ec2_base.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
#
|
2
3
|
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
4
|
# Copyright:: Copyright (c) 2011-2019 Chef Software, Inc.
|
@@ -67,8 +68,7 @@ class Chef
|
|
67
68
|
option :region,
|
68
69
|
long: "--region REGION",
|
69
70
|
description: "Your AWS region",
|
70
|
-
proc: Proc.new { |key| Chef::Config[:knife][:region] = key }
|
71
|
-
default: "us-east-1"
|
71
|
+
proc: Proc.new { |key| Chef::Config[:knife][:region] = key }
|
72
72
|
|
73
73
|
option :use_iam_profile,
|
74
74
|
long: "--use-iam-profile",
|
@@ -81,8 +81,8 @@ class Chef
|
|
81
81
|
|
82
82
|
def connection_string
|
83
83
|
conn = {}
|
84
|
-
conn[:region] = locate_config_value(:region)
|
85
|
-
Chef::Log.debug "Using AWS region #{
|
84
|
+
conn[:region] = locate_config_value(:region) || "us-east-1"
|
85
|
+
Chef::Log.debug "Using AWS region #{conn[:region]}"
|
86
86
|
conn[:credentials] =
|
87
87
|
if locate_config_value(:use_iam_profile)
|
88
88
|
Chef::Log.debug "Using iam profile for authentication as use_iam_profile set"
|
@@ -145,7 +145,6 @@ class Chef
|
|
145
145
|
%w{ebs_optimized image_id instance_id instance_type key_name platform public_dns_name public_ip_address private_dns_name private_ip_address root_device_type}.each do |id|
|
146
146
|
server_data[id] = server_obj.instances[0].send(id)
|
147
147
|
end
|
148
|
-
|
149
148
|
server_data["availability_zone"] = server_obj.instances[0].placement.availability_zone
|
150
149
|
server_data["groups"] = server_obj.groups.map(&:name)
|
151
150
|
server_data["iam_instance_profile"] = ( server_obj.instances[0].iam_instance_profile.nil? ? nil : server_obj.instances[0].iam_instance_profile.arn[%r{instance-profile/(.*)}] )
|
@@ -204,7 +203,6 @@ class Chef
|
|
204
203
|
errors = [] # track all errors so we report on all of them
|
205
204
|
|
206
205
|
validate_aws_config_file! if locate_config_value(:aws_config_file)
|
207
|
-
|
208
206
|
unless locate_config_value(:use_iam_profile) # skip config file / key validation if we're using iam profile
|
209
207
|
# validate the creds file if:
|
210
208
|
# aws keys have not been passed in config / CLI and the default cred file location does exist
|
@@ -331,7 +329,6 @@ class Chef
|
|
331
329
|
profile = locate_config_value(:aws_profile)
|
332
330
|
|
333
331
|
Chef::Log.debug "Using AWS profile #{profile}"
|
334
|
-
|
335
332
|
entries = if aws_creds.values.first.key?("AWSAccessKeyId")
|
336
333
|
aws_creds.values.first
|
337
334
|
else
|
data/lib/knife-ec2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|