capistrano-hivequeen 7.7.0 → 7.7.2
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 +17 -9
- data/lib/capistrano/hivequeen/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbc758d62e2ed6b55d9595a7afc5ffa694e6aa2f76bde859a36d44380960f009
|
4
|
+
data.tar.gz: 6f4ba43b6a19a9f93b950aadcfa39fefdb442ed2455728f1e7277d0cbb3ebff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 013b9d5bfa2a6e8d923dbe37a1d0b600dbb652aac1c2a3027b1fe17cb884a84af37d1781dfda9c4ad5f123d9b3ad3db087909fb3132e9a247f90e267e4afd281
|
7
|
+
data.tar.gz: 293fe44f13d0c942cd5458f2d45e0c40840bd7cbe1cb06e2eb410db29e906dc9ce7a2f778e12a50e2d13047f23742cd30e2b4737f17f145efdbb96bc4d96d025
|
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')
|
@@ -4,21 +4,28 @@ class HiveQueen
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def self.ec2_instance_connect_client
|
7
|
-
@ec2_instance_connect_client ||= Aws::EC2InstanceConnect::Client.new
|
7
|
+
@ec2_instance_connect_client ||= Aws::EC2InstanceConnect::Client.new(
|
8
|
+
retry_limit: 5,
|
9
|
+
retry_backoff: -> (c) { sleep(5) },
|
10
|
+
)
|
8
11
|
end
|
9
12
|
|
10
13
|
def self.ec2_instance_connect(*private_dns)
|
11
|
-
#
|
14
|
+
# Get SSH public key contents
|
12
15
|
ssh_public_key = File.read(File.expand_path('~/.ssh/ksr_ed25519.pub'))
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
|
17
|
+
# Get SSH bastion instance(s) from Name tag
|
18
|
+
ssh_params = { filters: [{ name: 'tag:Name', values: %w[ssh-bastion] }] }
|
19
|
+
logger.trace("ec2:DescribeInstances #{ssh_params.to_json}")
|
20
|
+
bastions = ec2_client.describe_instances(**ssh_params).reservations.map(&:instances).flatten
|
21
|
+
|
22
|
+
# Get EC2 instances from private DNS name
|
23
|
+
ec2_params = { filters: [{ name: 'network-interface.private-dns-name', values: private_dns }] }
|
19
24
|
logger.trace("ec2:DescribeInstances #{ec2_params.to_json}")
|
20
25
|
instances = ec2_client.describe_instances(**ec2_params).reservations.map(&:instances).flatten
|
21
|
-
|
26
|
+
|
27
|
+
# Collect EC2 Instance Connect request threads
|
28
|
+
threads = (bastions + instances).map do |instance|
|
22
29
|
Thread.new do
|
23
30
|
ec2ic_params = {
|
24
31
|
availability_zone: instance.placement.availability_zone,
|
@@ -31,6 +38,7 @@ class HiveQueen
|
|
31
38
|
end
|
32
39
|
end
|
33
40
|
|
41
|
+
# Execute EC2 Instance Connect request threads
|
34
42
|
threads.each(&:join)
|
35
43
|
end
|
36
44
|
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.2
|
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-11-22 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
|