capistrano-aws-hosts 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89c1f616a4238eef7b87fdf37581148287e44022
4
- data.tar.gz: b255dd86834cac8d44268b4f7b0f555480c175b8
3
+ metadata.gz: 77582895e7981f7c26846612838537b98e7d30ec
4
+ data.tar.gz: 35968314b0be5204afa292f9fbeeec4965432b1c
5
5
  SHA512:
6
- metadata.gz: 4e44ff9cdc8d5a9ebd2eb529954ca87f40cb903006143ec792c5bacef3bb17c8e297abf9ba15db9d5230b31559c884da4eed00290d24aa53ceb3c2421ceaf48a
7
- data.tar.gz: 078dcf83ccf60282c4245ec398bcc0a7d77051f50d92448d42cddcf49b00e85a79c40fa264a6e76d42a1b159346ea9c6c20e951f78abe10ad5f6a2b2ca7120ee
6
+ metadata.gz: ba6a153d052dd8d6953af818a4b79ae74c1c287d0f37685e73b30871a71e1c81ee3b49c4ed08c4e83d5140d37556e0a13f72ee87b4370b3afc6262c7f0149e32
7
+ data.tar.gz: d96cd8e03dde5c602d5366535be73412ce823e1d3d1cf8c56c8546c597c7b70676232d99004f56c543f0dab3c8d7690c1a0581fd5c74b040af67755ae5022317
@@ -5,15 +5,17 @@ module Capistrano
5
5
  module Hosts
6
6
  # Fetches the hosts from AWS, filtering based on the tag 'Role' values (wildcarded)
7
7
  #
8
+ # @param [String] filter_override an override for the :aws_hosts_filter capistrano setting
9
+ #
8
10
  # @return [Array<Struct(private_ip, instance_id, name>] array of instance records
9
- def fetch_aws_hosts
10
- role_name = fetch(:aws_hosts_filter)
11
+ def fetch_aws_hosts(filter_override = nil)
12
+ role_name = filter_override || fetch(:aws_hosts_filter)
11
13
  profile = fetch(:aws_hosts_profile) || ENV['AWS_PROFILE']
12
14
  region = fetch(:aws_region) || ENV['AWS_DEFAULT_REGION']
13
-
15
+
14
16
  raise 'Region is not specified - please set :aws_region or export AWS_DEFAULT_REGION as an environment variable' unless region.to_s != ''
15
17
  # raise "Profile is not specified - please set :aws_region or export AWS_DEFAULT_REGION as an environment variable" unless region.present?
16
-
18
+
17
19
  client = ::Aws::EC2::Client.new(region: region, profile: profile)
18
20
 
19
21
  instances = client.describe_instances(filters: [
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Aws
3
3
  module Hosts
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-aws-hosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Savage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.6.8
105
+ rubygems_version: 2.6.12
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Provide access to AWS EC2 inventory for deploy host targets