capistrano-hivequeen 7.7.0 → 7.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/capistrano-hivequeen.gemspec +1 -1
- data/lib/capistrano/hivequeen/ec2_instance_connect.rb +13 -8
- data/lib/capistrano/hivequeen/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ca77135ec2da064aa528ee926c64e0ff2cf97615aed3a8aa1d72813b3a8fb70
|
4
|
+
data.tar.gz: b456eb78e4f914da4fc6a5eaa3a99f0902336c2951b26437d4bf403f44f7bcae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1efcaa3895d677e108d881d3843b3d7a83343218e0d5d3868db439c85d33f0bf038d6ea0f2a31d0e22e5fcd707b23a99c1016d502b0244715ec785c923d6a64f
|
7
|
+
data.tar.gz: 97a8ea9475a996d9bb820c0c99bd55fbf7af635b30803e1f7a92ad3c64902bba5153560f49d9fa64486ecf0b6495985b31ae050ed14d19655bcc5c3105219d91
|
data/.gitignore
CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
## that are needed for an end user to actually USE your code.
|
41
41
|
s.add_dependency('aws-sdk-ec2', '~> 1.0')
|
42
42
|
s.add_dependency('aws-sdk-ec2instanceconnect', '~> 1.0')
|
43
|
-
s.add_dependency('capistrano', '
|
43
|
+
s.add_dependency('capistrano', '~> 2.11')
|
44
44
|
s.add_dependency('activesupport', '>= 3.0.0')
|
45
45
|
s.add_dependency('json')
|
46
46
|
s.add_dependency('egads', '>= 3.0.0')
|
@@ -8,17 +8,21 @@ class HiveQueen
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.ec2_instance_connect(*private_dns)
|
11
|
-
#
|
11
|
+
# Get SSH public key contents
|
12
12
|
ssh_public_key = File.read(File.expand_path('~/.ssh/ksr_ed25519.pub'))
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
|
14
|
+
# Get SSH bastion instance(s) from Name tag
|
15
|
+
ssh_params = { filters: [{ name: 'tag:Name', values: %w[ssh-bastion] }] }
|
16
|
+
logger.trace("ec2:DescribeInstances #{ssh_params.to_json}")
|
17
|
+
bastions = ec2_client.describe_instances(**ssh_params).reservations.map(&:instances).flatten
|
18
|
+
|
19
|
+
# Get EC2 instances from private DNS name
|
20
|
+
ec2_params = { filters: [{ name: 'network-interface.private-dns-name', values: private_dns }] }
|
19
21
|
logger.trace("ec2:DescribeInstances #{ec2_params.to_json}")
|
20
22
|
instances = ec2_client.describe_instances(**ec2_params).reservations.map(&:instances).flatten
|
21
|
-
|
23
|
+
|
24
|
+
# Collect EC2 Instance Connect request threads
|
25
|
+
threads = (bastions + instances).map do |instance|
|
22
26
|
Thread.new do
|
23
27
|
ec2ic_params = {
|
24
28
|
availability_zone: instance.placement.availability_zone,
|
@@ -31,6 +35,7 @@ class HiveQueen
|
|
31
35
|
end
|
32
36
|
end
|
33
37
|
|
38
|
+
# Execute EC2 Instance Connect request threads
|
34
39
|
threads.each(&:join)
|
35
40
|
end
|
36
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-hivequeen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.7.
|
4
|
+
version: 7.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Suggs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-ec2
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: capistrano
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.11
|
47
|
+
version: '2.11'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.11
|
54
|
+
version: '2.11'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
148
|
+
rubygems_version: 3.1.6
|
149
149
|
signing_key:
|
150
150
|
specification_version: 2
|
151
151
|
summary: Capistrano extensions for interacting with HiveQueen
|