knife-undev 0.0.7 → 0.0.8
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/knife/undev/monkey_patches/node_presenter.rb +50 -0
- data/lib/knife/undev/monkey_patches/ssh.rb +17 -0
- data/lib/knife/undev/version.rb +1 -1
- data/lib/knife/undev.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b10ee6fac2453b117a90410553a6da337329ab7
|
4
|
+
data.tar.gz: b966038f848f734a1e938a824b8fd4947c3ac759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73b67c4030e75b383c757014b88ca32954dabbc7ded496ecd1cb6e05f455d775c8c209e4949787b0de7b0f58ad2247af612412877f8a1f9ba8d0350f1245a296
|
7
|
+
data.tar.gz: ced24f8cad9ec235a9c97d8d6aa6ea36090c893bfa64cc69598e078730486dfe7d066161da995b8839bdaf97e992f6cb3b24c7d6b93ed75a1d453ed46f57dfd9
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'chef/knife'
|
2
|
+
require 'chef/knife/core/node_presenter'
|
3
|
+
|
4
|
+
class Chef
|
5
|
+
class Knife
|
6
|
+
module Core
|
7
|
+
|
8
|
+
def summarize(data)
|
9
|
+
if data.kind_of?(Chef::Node)
|
10
|
+
node = data
|
11
|
+
# special case ec2 with their split horizon whatsis.
|
12
|
+
ip = (node[:private_ipaddress]) || node[:ipaddress]
|
13
|
+
|
14
|
+
summarized=<<-SUMMARY
|
15
|
+
#{ui.color('Node Name:', :bold)} #{ui.color(node.name, :bold)}
|
16
|
+
#{key('Environment:')} #{node.chef_environment}
|
17
|
+
#{key('FQDN:')} #{node[:fqdn]}
|
18
|
+
#{key('IP:')} #{ip}
|
19
|
+
#{key('Private IP:')} #{node[:private_ipaddress]}
|
20
|
+
#{key('Run List:')} #{node.run_list}
|
21
|
+
#{key('Roles:')} #{Array(node[:roles]).join(', ')}
|
22
|
+
#{key('Recipes:')} #{Array(node[:recipes]).join(', ')}
|
23
|
+
#{key('Platform:')} #{node[:platform]} #{node[:platform_version]}
|
24
|
+
#{key('Tags:')} #{Array(node[:tags]).join(', ')}
|
25
|
+
SUMMARY
|
26
|
+
if config[:medium_output] || config[:long_output]
|
27
|
+
summarized +=<<-MORE
|
28
|
+
#{key('Attributes:')}
|
29
|
+
#{text_format(node.normal_attrs)}
|
30
|
+
MORE
|
31
|
+
end
|
32
|
+
if config[:long_output]
|
33
|
+
summarized +=<<-MOST
|
34
|
+
#{key('Default Attributes:')}
|
35
|
+
#{text_format(node.default_attrs)}
|
36
|
+
#{key('Override Attributes:')}
|
37
|
+
#{text_format(node.override_attrs)}
|
38
|
+
#{key('Automatic Attributes (Ohai Data):')}
|
39
|
+
#{text_format(node.automatic_attrs)}
|
40
|
+
MOST
|
41
|
+
end
|
42
|
+
summarized
|
43
|
+
else
|
44
|
+
super
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'chef/knife'
|
2
|
+
require 'chef/knife/ssh'
|
3
|
+
|
4
|
+
class Chef
|
5
|
+
class Knife
|
6
|
+
class Ssh
|
7
|
+
|
8
|
+
def configure_attribute
|
9
|
+
config[:override_attribute] = config[:attribute] || Chef::Config[:knife][:ssh_attribute]
|
10
|
+
config[:attribute] = (Chef::Config[:knife][:ssh_attribute] ||
|
11
|
+
config[:attribute] || "private_ipaddress").strip
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/lib/knife/undev/version.rb
CHANGED
data/lib/knife/undev.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-undev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasiliev Dmitry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
@@ -99,7 +99,9 @@ files:
|
|
99
99
|
- knife-undev.gemspec
|
100
100
|
- lib/knife/undev.rb
|
101
101
|
- lib/knife/undev/converter.rb
|
102
|
+
- lib/knife/undev/monkey_patches/node_presenter.rb
|
102
103
|
- lib/knife/undev/monkey_patches/object_loader.rb
|
104
|
+
- lib/knife/undev/monkey_patches/ssh.rb
|
103
105
|
- lib/knife/undev/version.rb
|
104
106
|
homepage: ''
|
105
107
|
licenses:
|