bundles/icinga2: allow limiting permissions for api users

This commit is contained in:
Franzi 2020-12-20 09:33:17 +01:00
parent 374ba3c16a
commit 0b52f8e7e6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,7 @@
% for user, password in sorted(node.metadata.get('icinga2', {}).get('api_users', {}).items()): % for user, config in sorted(node.metadata.get('icinga2', {}).get('api_users', {}).items()):
object ApiUser "${user}" { object ApiUser "${user}" {
password = "${password}" password = "${config['password']}"
permissions = [ "*" ] permissions = [ "${'", "'.join(sorted(config['permissions']))}" ]
} }
% endfor % endfor

View file

@ -30,7 +30,12 @@ defaults = {
}, },
'icinga2': { 'icinga2': {
'api_users': { 'api_users': {
'root': repo.vault.password_for(f'{node.name} icinga2 api root'), 'root': {
'password': repo.vault.password_for(f'{node.name} icinga2 api root'),
'permissions': {
'*',
},
},
}, },
}, },
'icinga2_api': { 'icinga2_api': {