knuckle_cluster 2.0.0 → 2.1.0

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: 59963fda23e1d0884eac11bf2a2847143e401bdc
4
- data.tar.gz: d928d2f5075505884aa89f32ebbdb62acd66b0a9
3
+ metadata.gz: a45740ee1e2f621c56a0797856e5e35b8c1a4f0a
4
+ data.tar.gz: 491c8b5a5cbea377eccd8398e50e06d437947fbe
5
5
  SHA512:
6
- metadata.gz: ba13719e348fd5fa75ed0de38820e37e1629d3992c747e5a9d61a2f9ec71550923b3b1ce98671749b1bf329be615caa826a4f57fbafc1a40597312b3fa97791d
7
- data.tar.gz: c42358f506487275be118c2654f58167fc0233a6c366c9ec39e1597e4bebcd691688cc17c0988310c1ede496dcbee305adf2af5778fd2237319627d911ab8350
6
+ metadata.gz: 4e4985e14bd91410df373307d0dea915e597946b8e5f5c6ecd94e194abf0cefda86d4431449323650563475a3a09cd6e9995345dab24f719414c8316981f35ca
7
+ data.tar.gz: 83a2963607d32e6ec4694512bcef3e1618113226c23454446b3ee00fa1e6e131b914983370df040496e980b190e921623157f42130ca1c0384be2e883bd43c61
data/README.md CHANGED
@@ -89,6 +89,17 @@ default_platform: &default_platform
89
89
  ssh_username: ubuntu
90
90
  sudo: true
91
91
  aws_vault_profile: platform_super_user
92
+
93
+ other_platform: &other_platform
94
+ region: us-east-1
95
+ bastion:
96
+ username: ubuntu
97
+ host: bastion.endpoint.example.com
98
+ rsa_key_location: ~/.ssh/bastion_rsa_key
99
+ rsa_key_location: ~/.ssh/platform_rsa_key
100
+ ssh_username: ubuntu
101
+ sudo: true
102
+ aws_vault_profile: platform_super_user
92
103
  ```
93
104
 
94
105
  See [Options for Knuckle Cluster](#options-for-knuckle-cluster) below for a list of what each option does.
@@ -191,7 +202,7 @@ cluster_name | The name of the cluster (not the ARN). eg 'my-super-cluster'. One
191
202
  spot_request_id | The spot request ID you are connecting to. eg 'sfr-abcdef'. One of `cluster_name`,`spot_request_id` or `asg_name` is required.
192
203
  asg_name | The auto-scaling group name you are connecting to. eg 'very-scaly-group'. One of `cluster_name`,`spot_request_id` or `asg_name` is required.
193
204
  region | The AWS region you would like to use. Defaults to `us-east-1`
194
- bastion | if you have a bastion to proxy to your ecs cluster via ssh, put the name of it here as defined in your `~/.ssh/config` file.
205
+ bastion | if you have a bastion to proxy to your ecs cluster via ssh, put the name of it here as defined in your `~/.ssh/config` file. Alternatively, this can be a collection of keys for `username`, `host`, and `rsa_key_location`
195
206
  rsa_key_location | The RSA key needed to connect to an ecs agent eg `~/.ssh/id_rsa`.
196
207
  ssh_username | The username to conncet. Will default to `ec2-user`
197
208
  sudo | true or false - will sudo the `docker` command on the target machine. Usually not needed unless the user is not a part of the `docker` group.
@@ -1,3 +1,3 @@
1
1
  module KnuckleCluster
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -189,7 +189,11 @@ module KnuckleCluster
189
189
  ip = bastion ? agent.private_ip : agent.public_ip
190
190
  command = "ssh #{ip} -l#{ssh_username}"
191
191
  command += " -i #{rsa_key_location}" if rsa_key_location
192
- command += " -o ProxyCommand='ssh -qxT #{bastion} nc #{ip} 22'" if bastion
192
+ if bastion.is_a? String
193
+ command += " -o ProxyCommand='ssh -qxT #{bastion} nc #{ip} 22'"
194
+ elsif bastion.is_a? Hash
195
+ command += " -o Proxycommand='ssh -qxt #{bastion[:host]} -l#{bastion[:username]} -i #{bastion[:rsa_key_location]} nc #{ip} 22'"
196
+ end
193
197
  command += " -L #{port_forward}" if port_forward
194
198
  command += " -t \"#{subcommand}\"" if subcommand
195
199
  command
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knuckle_cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Envato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler