bundles/icinga2: generate icinga_users from users.json
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
c77856f97a
commit
12cf03e03f
4 changed files with 38 additions and 7 deletions
|
@ -2,13 +2,20 @@ object UserGroup "on-call_sms" {
|
|||
display_name = "On-Call Support"
|
||||
}
|
||||
|
||||
% for username in sorted(node.metadata.get('icinga2', {}).get('icinga_users', {})):
|
||||
% for username, config in sorted(node.metadata.get('icinga2', {}).get('icinga_users', {}).items()):
|
||||
object User "${username}" {
|
||||
display_name = "${username}"
|
||||
enable_notifications = true
|
||||
period = "24x7" # Is overwritten in notifications.conf
|
||||
period = "24x7"
|
||||
states = [ OK, Critical, Up, Down ]
|
||||
types = [ Problem, Recovery ]
|
||||
|
||||
% if config['is_admin']:
|
||||
groups = [ "on-call_sms" ]
|
||||
% endif
|
||||
|
||||
email = "${config['email']}"
|
||||
vars.mobile = "${config['phone']}"
|
||||
}
|
||||
|
||||
% endfor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue