owssh 0.0.18 → 0.0.20
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 +4 -4
- data/lib/owssh.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7221dddfa2ad3f3485d227fede880a2bf1934af1
|
4
|
+
data.tar.gz: 98ea134bf194d5833f1b906ee7a7cda30281c572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19d2a1e81ddd71555166cf57aa87b8893e107d738a50a191b0f564750150da2bb8e4697fbdf7d1d03869d3560ec7a26ab45929437de24be971087976ac4d67c5
|
7
|
+
data.tar.gz: ac27448595151c13448025ecf03e84fca72e707be427b2285ec2c151ad83b5f16c33a01f0f459e626bc1abd0953e08a10f266b7bb9c43f5cc0af2437ac53e075
|
data/lib/owssh.rb
CHANGED
@@ -8,9 +8,12 @@ require 'command_line_reporter'
|
|
8
8
|
class Owssh
|
9
9
|
include CommandLineReporter
|
10
10
|
|
11
|
+
$aws_profile = "default"
|
12
|
+
$aws_config_file = "~/.aws/config.owssh"
|
13
|
+
|
11
14
|
def get_stacks
|
12
15
|
my_stacks = {}
|
13
|
-
stacks_json = JSON.parse(`aws opsworks describe-stacks`)
|
16
|
+
stacks_json = JSON.parse(`AWS_CONFIG_FILE=#{$aws_config_file} aws --profile #{$aws_profile} opsworks describe-stacks`)
|
14
17
|
|
15
18
|
stacks_json['Stacks'].each do |stack|
|
16
19
|
if $debug then puts "Stack Name: #{stack['Name'].gsub(' ','_').downcase} Stack ID: #{stack['StackId']}" end
|
@@ -22,7 +25,7 @@ class Owssh
|
|
22
25
|
|
23
26
|
def get_instances(id)
|
24
27
|
my_instances = {}
|
25
|
-
instances_json = JSON.parse(`aws opsworks describe-instances --stack-id #{id}`)
|
28
|
+
instances_json = JSON.parse(`AWS_CONFIG_FILE=#{$aws_config_file} aws --profile #{$aws_profile} opsworks describe-instances --stack-id #{id}`)
|
26
29
|
instances_json['Instances'].each do |instance|
|
27
30
|
pub_ip = instance['ElasticIp'] || instance['PublicIp'] || "DOWN"
|
28
31
|
priv_ip = instance['PrivateIp'] || "N/A"
|