capistrano-aws-hosts 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/aws/hosts.rb +6 -4
- data/lib/capistrano/aws/hosts/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77582895e7981f7c26846612838537b98e7d30ec
|
4
|
+
data.tar.gz: 35968314b0be5204afa292f9fbeeec4965432b1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba6a153d052dd8d6953af818a4b79ae74c1c287d0f37685e73b30871a71e1c81ee3b49c4ed08c4e83d5140d37556e0a13f72ee87b4370b3afc6262c7f0149e32
|
7
|
+
data.tar.gz: d96cd8e03dde5c602d5366535be73412ce823e1d3d1cf8c56c8546c597c7b70676232d99004f56c543f0dab3c8d7690c1a0581fd5c74b040af67755ae5022317
|
data/lib/capistrano/aws/hosts.rb
CHANGED
@@ -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: [
|
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.
|
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-
|
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.
|
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
|