chef-handler-motd 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -1
- data/chef-handler-motd-0.1.0.gem +0 -0
- data/chef-handler-motd.gemspec +2 -2
- data/lib/chef-handler-motd.rb +5 -2
- metadata +4 -3
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# ChefMOTD handler
|
2
2
|
Update your MOTD after a Chef run with various data
|
3
3
|
|
4
4
|
# Usage
|
@@ -29,6 +29,9 @@ chef_handler 'ChefMOTD' do
|
|
29
29
|
end
|
30
30
|
```
|
31
31
|
|
32
|
+
### Arguments
|
33
|
+
* `priority` - Determines where the Chef data is displayed in MOTD (default 05)
|
34
|
+
|
32
35
|
# Author
|
33
36
|
Ops at Simple <ops@simple.com>
|
34
37
|
|
Binary file
|
data/chef-handler-motd.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'chef-handler-motd'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.1'
|
4
4
|
s.author = 'Simple Finance'
|
5
5
|
s.email = 'ops@simple.com'
|
6
|
-
s.homepage = 'http://github.com/SimpleFinance/chef-handler-
|
6
|
+
s.homepage = 'http://github.com/SimpleFinance/chef-handler-motd'
|
7
7
|
s.summary = 'Edits MOTD at the end of a Chef run'
|
8
8
|
s.description = 'Edits MOTD at the end of a Chef run'
|
9
9
|
s.files = ::Dir.glob('**/*')
|
data/lib/chef-handler-motd.rb
CHANGED
@@ -34,13 +34,16 @@ class ChefMOTD < Chef::Handler
|
|
34
34
|
msg = <<-eos
|
35
35
|
#!/bin/sh
|
36
36
|
echo \"Node #{node.name} last success: #{Time.now.to_s} in #{run_status.elapsed_time}\"
|
37
|
-
echo \"Updated resources (total: #{run_status.updated_resources.length}):\"
|
37
|
+
echo \"Updated resources on last run (total: #{run_status.updated_resources.length}):\"
|
38
38
|
eos
|
39
39
|
run_status.updated_resources.each do |res|
|
40
40
|
msg += "echo \" #{res.resource_name}[#{res.name}]\"\n"
|
41
41
|
end
|
42
42
|
if run_status.success?
|
43
|
-
::
|
43
|
+
Chef::Log.info 'Updating Chef info in MOTD ...'
|
44
|
+
file = "/etc/update-motd.d/#{@priority}-chef-motd"
|
45
|
+
f = ::File.open(file, 'w') {|f| f.puts msg}
|
46
|
+
::File.chmod(0755, file)
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-handler-motd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Edits MOTD at the end of a Chef run
|
15
15
|
email: ops@simple.com
|
@@ -17,11 +17,12 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- chef-handler-motd-0.1.0.gem
|
20
21
|
- chef-handler-motd.gemspec
|
21
22
|
- lib/chef-handler-motd.rb
|
22
23
|
- LICENSE
|
23
24
|
- README.md
|
24
|
-
homepage: http://github.com/SimpleFinance/chef-handler-
|
25
|
+
homepage: http://github.com/SimpleFinance/chef-handler-motd
|
25
26
|
licenses: []
|
26
27
|
post_install_message:
|
27
28
|
rdoc_options: []
|