opzworks 0.3.3 → 0.3.4

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: 54a8db4d18a1f2f35249675c31e549b5abf8af6d
4
- data.tar.gz: 3ec49b3d90823083a8c8c01a22df12c3fb09deda
3
+ metadata.gz: 83bf02242ab0c6ce1bbdada77d52bfe7950a0e2e
4
+ data.tar.gz: 2c227652c0bfffb9d0a4ef31e87ddea8502332c8
5
5
  SHA512:
6
- metadata.gz: 52886e13f13d4b5fc104d42b350ea2dcc800fafc74a5aa76cfe08dd35770487721851e7764d381a60b2663651437a625dd54275ce9aea6f14586980df7de41a2
7
- data.tar.gz: 058975fdb065b9c4f518abb18fe9736140b650fe58ff0a5359b6004614c4d9643cf4a6a9f79421da732e607846098790004361cb2234d61e333349e650039963
6
+ metadata.gz: 1f53f15687081918bbd33d4f9a5a8ba309ddbee9df6532c4c015dd200ee71fb76775446f7921b254896ed3040a9235481ff24f4b00ee7208a289731d47cbc4f6
7
+ data.tar.gz: 2e025f3a38effbe2ed4d783e37aee44bcf7761187acf8e19ddb2cf4b51682892f7f4793709fc79614b2d49eccd1d72f63870e61e5e8cbc82ea890011f02b94fc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  changelog
2
2
  =========
3
3
 
4
+ 0.3.4
5
+ -----
6
+ * -r option for `ssh` to return raw ips
7
+
4
8
  0.3.0
5
9
  -----
6
10
  * attempt to clone opsworks-${project} repo if not found
@@ -28,6 +28,7 @@ module OpzWorks
28
28
  opt :backup, 'Backup old SSH config before updating'
29
29
  opt :quiet, 'Use SSH LogLevel quiet', default: true
30
30
  opt :private, 'Use private ips to populate SSH config, rather than public', default: false
31
+ opt :raw, 'Return only raw IPs rather than .ssh/config format output', default: false
31
32
  end
32
33
 
33
34
  config = OpzWorks.config
@@ -61,16 +62,21 @@ module OpzWorks
61
62
  else
62
63
  instance[:elastic_ip].nil? ? ip = instance[:public_ip] : ip = instance[:elastic_ip]
63
64
  end
64
- parameters = {
65
- 'Host' => "#{instance[:hostname]}-#{stack_name}",
66
- 'HostName' => ip,
67
- 'User' => config.ssh_user_name
68
- }
69
- parameters['LogLevel'] = 'quiet' if options[:quiet]
70
- parameters.map { |param| param.join(' ') }.join("\n ")
65
+
66
+ if options[:raw]
67
+ puts ip
68
+ else
69
+ parameters = {
70
+ 'Host' => "#{instance[:hostname]}-#{stack_name}",
71
+ 'HostName' => ip,
72
+ 'User' => config.ssh_user_name
73
+ }
74
+ parameters['LogLevel'] = 'quiet' if options[:quiet]
75
+ parameters.map { |param| param.join(' ') }.join("\n ")
76
+ end
71
77
  end
72
78
 
73
- new_contents = "#{instances.join("\n")}\n"
79
+ new_contents = "#{instances.join("\n")}\n" unless options[:raw]
74
80
 
75
81
  if options[:update]
76
82
  ssh_config = "#{ENV['HOME']}/.ssh/config"
@@ -91,7 +97,7 @@ module OpzWorks
91
97
 
92
98
  puts "Successfully updated #{ssh_config} with #{instances.length} instances!"
93
99
  else
94
- puts new_contents.strip
100
+ puts new_contents.strip unless options[:raw]
95
101
  end
96
102
  end
97
103
  end
data/lib/opzworks/meta.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module OpzWorks
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  AUTHORS = ['Grant Heffernan', 'Mapzen']
4
4
  EMAIL = ['grant@mapzen.com']
5
5
  DESCRIPTION = 'OpzWorks Utilities'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opzworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Heffernan