bundlewrap/bundles/pretalx/metadata.py

71 lines
2 KiB
Python
Raw Permalink Normal View History

2021-01-16 21:03:38 +00:00
defaults = {
'apt': {
'packages': {
2023-09-09 15:48:22 +00:00
'gcc': {}, # for compiling some python deps
2021-01-16 21:03:38 +00:00
'gettext': {},
2023-09-09 15:48:22 +00:00
'python3-dev': {},
2021-01-16 21:03:38 +00:00
},
},
2023-09-09 15:48:22 +00:00
'bash_aliases': {
'pretalx': 'sudo /opt/pretalx/venv/bin/python -m pretalx',
},
2021-01-16 21:03:38 +00:00
'backups': {
'paths': {
'/opt/pretalx/data',
},
},
'icinga2_api': {
'pretalx': {
2021-01-16 21:03:38 +00:00
'services': {
'PRETALX-WEB PROCESS': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_systemd_unit pretalx-web',
},
'PRETALX-WORKER PROCESS': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_systemd_unit pretalx-worker',
},
},
},
},
'pretalx': {
'database': {
'user': 'pretalx',
'password': repo.vault.password_for('{} postgresql pretalx'.format(node.name)),
'database': 'pretalx',
},
},
'postgresql': {
'roles': {
'pretalx': {
'password': repo.vault.password_for('{} postgresql pretalx'.format(node.name)),
},
},
'databases': {
'pretalx': {
'owner': 'pretalx',
},
},
},
}
@metadata_reactor.provides(
'icinga2_api/pretalx/services',
)
def icinga_check_for_new_release(metadata):
version = metadata.get('pretalx/version')
if '.' not in version:
return {}
2021-01-16 21:03:38 +00:00
return {
'icinga2_api': {
'pretalx': {
'services': {
'PRETALX UPDATE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_pypi_for_new_release pretalx {}'.format(version),
2021-01-16 21:03:38 +00:00
'vars.notification.mail': True,
'check_interval': '60m',
},
},
},
},
}