Skip to content

Commit

Permalink
Have the various sensu_*_config classes autonotify their respective s…
Browse files Browse the repository at this point in the history
…ervices
  • Loading branch information
rodjek committed Apr 29, 2012
1 parent 6d45c4c commit 9715955
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/puppet/type/sensu_api_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Puppet::Type.newtype(:sensu_api_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-api]",
"Service[sensu-dashboard]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down
9 changes: 9 additions & 0 deletions lib/puppet/type/sensu_check_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Puppet::Type.newtype(:sensu_check_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-client]",
"Service[sensu-server]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down
8 changes: 8 additions & 0 deletions lib/puppet/type/sensu_client_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Puppet::Type.newtype(:sensu_client_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-client]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down
8 changes: 8 additions & 0 deletions lib/puppet/type/sensu_dashboard_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Puppet::Type.newtype(:sensu_dashboard_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-dashboard]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down
8 changes: 8 additions & 0 deletions lib/puppet/type/sensu_handler_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Puppet::Type.newtype(:sensu_handler_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-server]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down
10 changes: 10 additions & 0 deletions lib/puppet/type/sensu_rabbitmq_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Puppet::Type.newtype(:sensu_rabbitmq_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-server]",
"Service[sensu-client]",
"Service[sensu-api]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down
9 changes: 9 additions & 0 deletions lib/puppet/type/sensu_redis_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Puppet::Type.newtype(:sensu_redis_config) do
@doc = ""

def initialize(*args)
super

self[:notify] = [
"Service[sensu-api]",
"Service[sensu-server]",
].select { |ref| catalog.resource(ref) }
end

ensurable do
newvalue(:present) do
provider.create
Expand Down

0 comments on commit 9715955

Please sign in to comment.