ec2-host 0.0.5 → 0.0.6
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/CHANGELOG.md +6 -0
- data/README.md +2 -0
- data/ec2-host.gemspec +1 -1
- data/lib/ec2/host/cli.rb +16 -1
- 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: 02bef88973232ed12b815884d0ff5c5e38938921
|
4
|
+
data.tar.gz: 88e6ecc818e0afae83cc8b10de6671e3cd74b2aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3d2cc71f802293588dcd184dd1fd18a4f5de92fe57f3f1412b1bc2437258063a13b65ba4b953797e7cbb6963b2ed0967644d7211acf3f9b5a7a523bf6406717
|
7
|
+
data.tar.gz: c511301344134ef8bfabddf0686e8ac19e7cc2dddb85647875ade4bafe1653a2c85e8009f15d4e1a7f3bed4606984fc760372ee9e6204760a422def033ce2c11
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -62,6 +62,8 @@ Options:
|
|
62
62
|
--r1, --usage1, --u1, [--role1=one two three] # role1, the 1st part of role delimited by :
|
63
63
|
--r2, --usage2, --u2, [--role2=one two three] # role2, the 2nd part of role delimited by :
|
64
64
|
--r3, --usage3, --u3, [--role3=one two three] # role3, the 3rd part of role delimited by :
|
65
|
+
--ip, [--private-ip], [--no-private-ip] # show private ip address instead of hostname
|
66
|
+
[--public-ip], [--no-public-ip] # show public ip address instead of hostname
|
65
67
|
-i, [--info], [--no-info] # show host info, not only hostname
|
66
68
|
[--debug], [--no-debug] # debug mode
|
67
69
|
|
data/ec2-host.gemspec
CHANGED
data/lib/ec2/host/cli.rb
CHANGED
@@ -30,6 +30,13 @@ class EC2
|
|
30
30
|
Config.optional_options.each do |opt, tag|
|
31
31
|
option opt, :type => :array, :desc => opt
|
32
32
|
end
|
33
|
+
option :private_ip,
|
34
|
+
:aliases => %w[--ip],
|
35
|
+
:type => :boolean,
|
36
|
+
:desc => 'show private ip address instead of hostname'
|
37
|
+
option :public_ip,
|
38
|
+
:type => :boolean,
|
39
|
+
:desc => 'show public ip address instead of hostname'
|
33
40
|
option :info,
|
34
41
|
:aliases => %w[-i],
|
35
42
|
:type => :boolean,
|
@@ -42,6 +49,14 @@ class EC2
|
|
42
49
|
EC2::Host.new(condition).each do |host|
|
43
50
|
$stdout.puts host.info
|
44
51
|
end
|
52
|
+
elsif options[:private_ip]
|
53
|
+
EC2::Host.new(condition).each do |host|
|
54
|
+
$stdout.puts host.private_ip_address
|
55
|
+
end
|
56
|
+
elsif options[:public_ip]
|
57
|
+
EC2::Host.new(condition).each do |host|
|
58
|
+
$stdout.puts host.public_ip_address
|
59
|
+
end
|
45
60
|
else
|
46
61
|
EC2::Host.new(condition).each do |host|
|
47
62
|
$stdout.puts host.hostname
|
@@ -53,7 +68,7 @@ class EC2
|
|
53
68
|
|
54
69
|
def condition
|
55
70
|
return @condition if @condition
|
56
|
-
_condition = HashUtil.except(options, :info, :debug)
|
71
|
+
_condition = HashUtil.except(options, :info, :debug, :private_ip, :public_ip)
|
57
72
|
@condition = {}
|
58
73
|
_condition.each do |key, val|
|
59
74
|
if tag = Config.optional_options[key.to_s]
|