chef-handler-status_notifier 0.4.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chef-handler-status_notifier.gemspec +1 -1
- data/lib/chef/handler/status_notifier.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 238af0547571c1b90ff6823f98a3c9f419bce86c
|
4
|
+
data.tar.gz: 39fb8a8d17ef4cb4c07c096f90002e86e5b35f69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c82dab95ffbc792b8d01ed971d12e4952faedd589a113cef9c4531221cc1a709047827cea550e94ab21c930d53461373434f5c6d80169bafb024714c8d16d424
|
7
|
+
data.tar.gz: b4d3f2ea26fae7884e35e4a1f6ffaeed8bb922cd5adbbc2e8c1bad0b3a599fe888391c3197cc2f82cd2a2b473035f52f128fc6e394306b15347650530c6658f7
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "chef-handler-status_notifier"
|
6
|
-
spec.version = "0.4.
|
6
|
+
spec.version = "0.4.2"
|
7
7
|
spec.authors = ["Faizal Zakaria"]
|
8
8
|
spec.email = ["phaibusiness@gmail.com"]
|
9
9
|
spec.summary = %q{Chef status notifier handler}
|
@@ -32,7 +32,7 @@ class StatusNotifierHandler < Chef::Handler
|
|
32
32
|
status = :success
|
33
33
|
end
|
34
34
|
|
35
|
-
send_to_slack(status, msg)
|
35
|
+
send_to_slack(node.name, status, msg)
|
36
36
|
send_to_hipchat(msg)
|
37
37
|
end
|
38
38
|
|
@@ -43,11 +43,11 @@ class StatusNotifierHandler < Chef::Handler
|
|
43
43
|
hipchat[@hipchat_params[:room_name]].send(@hipchat_params[:username], msg, :notify => @hipchat_params[:notify])
|
44
44
|
end
|
45
45
|
|
46
|
-
def send_to_slack(status, msg)
|
46
|
+
def send_to_slack(node_name, status, msg)
|
47
47
|
return unless @slack_params[:enabled]
|
48
48
|
slack.channel = @slack_params[:channel]
|
49
49
|
slack.username = @slack_params[:username]
|
50
|
-
slack.ping '', attachments: [slack_attachment(status, msg)]
|
50
|
+
slack.ping '', attachments: [slack_attachment(node_name, status, msg)]
|
51
51
|
end
|
52
52
|
|
53
53
|
def hipchat
|
@@ -58,12 +58,12 @@ class StatusNotifierHandler < Chef::Handler
|
|
58
58
|
@slack ||= Slack::Notifier.new(@slack_params[:webhook_url])
|
59
59
|
end
|
60
60
|
|
61
|
-
def slack_attachment(status, msg)
|
61
|
+
def slack_attachment(node_name, status, msg)
|
62
62
|
color = (status == :failed)? "#ff0000" : "#36a64f"
|
63
63
|
{
|
64
64
|
fallback: "Opsworks status, #{msg}",
|
65
65
|
color: "#{color}",
|
66
|
-
author_name: "OpsworksBot (",
|
66
|
+
author_name: "OpsworksBot (#{node_name})",
|
67
67
|
title: "status: #{status}",
|
68
68
|
text: "#{msg}"
|
69
69
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-handler-status_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Faizal Zakaria
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.4.
|
94
|
+
rubygems_version: 2.4.2
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Chef status notifier handler
|