Implemented a data bag for the url config
This commit is contained in:
parent
ea911dfb35
commit
cb20962269
@ -2,4 +2,4 @@ default[:mon_notification][:user] = 'mon-notification'
|
||||
default[:mon_notification][:group] = 'mon-notification'
|
||||
default[:mon_notification][:conf_dir] = '/etc/mon'
|
||||
default[:mon_notification][:log_dir] = '/var/log/mon-notification'
|
||||
default[:mon_notification][:smtp_server] = 'localhost'
|
||||
default[:mon_notification][:data_bag] = 'mon_notification'
|
||||
|
@ -4,4 +4,4 @@ maintainer_email 'hpcs-mon@hp.com'
|
||||
license 'All rights reserved'
|
||||
description 'Installs/Configures mon_notification'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '0.1.8'
|
||||
version '0.1.9'
|
||||
|
@ -43,12 +43,16 @@ directory node[:mon_notification][:log_dir] do
|
||||
mode 0775
|
||||
end
|
||||
|
||||
# todo - setup a data bag for the config details and an encrypted one for credentials
|
||||
# todo - setup an encrypted data bag for credentials
|
||||
hosts = data_bag_item(node[:mon_notification][:data_bag], 'hosts')
|
||||
template "#{node[:mon_notification][:conf_dir]}/notification.yaml" do
|
||||
action :create
|
||||
source 'notification.yaml.erb'
|
||||
owner 'root'
|
||||
group node[:mon_notification][:group]
|
||||
mode 0640
|
||||
variables(
|
||||
:hosts => hosts
|
||||
)
|
||||
notifies :restart, "service[mon-notification]"
|
||||
end
|
||||
|
@ -1,17 +1,17 @@
|
||||
kafka:
|
||||
url: 192.168.10.10:9092
|
||||
url: <%= @hosts['kafka'] %>:9092
|
||||
group: <%= node[:mon_notification][:group] %>
|
||||
alarm_topic: alarm-state-transitions
|
||||
notification_topic: alarm-notifications
|
||||
|
||||
mysql:
|
||||
host: 192.168.10.6
|
||||
host: <%= @hosts['mysql'] %>
|
||||
user: notification
|
||||
passwd: password
|
||||
db: mon
|
||||
|
||||
email:
|
||||
server: <%= node[:mon_notification][:smtp_server] %>
|
||||
server: <%= @hosts['smtp'] %>
|
||||
port: 25
|
||||
user:
|
||||
password:
|
||||
@ -32,7 +32,7 @@ queues:
|
||||
sent_notifications_size: 50 # limiting this size reduces potential # of re-sent notifications after a failure
|
||||
|
||||
zookeeper:
|
||||
url: 192.168.10.10:2181
|
||||
url: <%= @hosts['zookeeper'] %>:2181
|
||||
max_offset_lag: 600 # In seconds, undefined for none
|
||||
|
||||
logging: # Used in logging.dictConfig
|
||||
|
Loading…
x
Reference in New Issue
Block a user