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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f46ac6b803396196b68b6c4189fbfe5a558f610d
4
- data.tar.gz: 2ef29efee61530660cfcf296896b690e06e18988
3
+ metadata.gz: 238af0547571c1b90ff6823f98a3c9f419bce86c
4
+ data.tar.gz: 39fb8a8d17ef4cb4c07c096f90002e86e5b35f69
5
5
  SHA512:
6
- metadata.gz: c08b20496949c92206042d3104e5aabca5afa04952022e5466431dacfe8ba617f6a0884fc29bfbc8078d5a2deae44a1a529c8e0545af3c0987792a18a9771499
7
- data.tar.gz: f3543c490274eb01ca9267a6c6fdd2536a8ebd8a4bdff2c89cc82739bbd882c8738424375f3aec8ae57f74f3ae644538668ffd76032e0baf13f81dd4446df054
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.0"
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.0
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.7
94
+ rubygems_version: 2.4.2
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Chef status notifier handler