chef-handler-slnky 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/chef/handler/slnky.rb +4 -0
- data/lib/chef/handler/slnky/version.rb +1 -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: 530304442a0689c92d3935227070f514005a3428
|
4
|
+
data.tar.gz: b9e07ac36ee91b5898b0b5ea0eb8ad1c87456499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 404a0dcf9d62a0f2d14f914aee8973bfaada0f16cde0bdc756130ece429bb54aa8f4087304f207bb51284ce97ab7b77e1f2efba46410108d49b845b2c4674077
|
7
|
+
data.tar.gz: 2865a051d775d240ab6c9a1cde3ef27a8a334fd3a61db42f6bf46a847f821f53f15e640aaf2d3d241c7e123c48bd0d40c50014250324dafd7b0b91b7ea54c383
|
data/README.md
CHANGED
@@ -45,6 +45,8 @@ Create a recipe with the following:
|
|
45
45
|
# `node['slnky']['url']`
|
46
46
|
# set this in a recipe or attributes file to point the handler
|
47
47
|
# to the server
|
48
|
+
# if you set `node['slnky']['file']` to the location of a yaml file
|
49
|
+
# it will load the data and include it in the event in the `attributes` key
|
48
50
|
chef_gem "chef-handler-slnky" do
|
49
51
|
action :upgrade
|
50
52
|
end
|
data/lib/chef/handler/slnky.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "chef/handler/slnky/version"
|
2
2
|
require 'chef/handler'
|
3
3
|
require 'slnky'
|
4
|
+
require 'yaml'
|
4
5
|
|
5
6
|
class Chef
|
6
7
|
class Handler
|
@@ -9,9 +10,12 @@ class Chef
|
|
9
10
|
def report
|
10
11
|
event = "chef.run.#{run_status.success? ? 'success' : 'failure'}"
|
11
12
|
server = node['slnky']['url']
|
13
|
+
file = node['slnky']['yaml']
|
14
|
+
attrs = file && File.exists?(file) ? YAML.load_file(file) : {}
|
12
15
|
data = {
|
13
16
|
name: event,
|
14
17
|
node: node.name,
|
18
|
+
attributes: attrs,
|
15
19
|
elapsed: run_status.elapsed_time,
|
16
20
|
exception: run_status.exception,
|
17
21
|
updated: run_status.updated_resources.count,
|