2020-12-31 11:18:34 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'libolm-dev': {},
|
|
|
|
'golang-go': {},
|
|
|
|
},
|
|
|
|
},
|
2021-01-29 16:27:33 +00:00
|
|
|
'cron': {
|
2021-07-29 15:13:08 +00:00
|
|
|
'restart_mautrix_whatsapp': '0 3 * * * root systemctl restart mautrix-whatsapp.service',
|
2021-01-29 16:27:33 +00:00
|
|
|
},
|
2020-12-31 11:18:34 +00:00
|
|
|
'icinga2_api': {
|
|
|
|
'mautrix-whatsapp': {
|
|
|
|
'services': {
|
|
|
|
'MAUTRIX-WHATSAPP PROCESS': {
|
2020-12-31 11:31:14 +00:00
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -a mautrix-whatsapp -c 1:',
|
2020-12-31 11:18:34 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'matrix-synapse': {
|
|
|
|
'appservice_configs': {
|
|
|
|
'/opt/mautrix-whatsapp/registration.yaml',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'mautrix-whatsapp': {
|
|
|
|
'database': {
|
|
|
|
'user': 'mautrix-whatsapp',
|
|
|
|
'password': repo.vault.password_for('{} postgresql mautrix-whatsapp'.format(node.name)),
|
|
|
|
'database': 'mautrix-whatsapp',
|
|
|
|
},
|
|
|
|
'as_token': repo.vault.password_for('{} mautrix-whatsapp as_token'.format(node.name)),
|
|
|
|
'hs_token': repo.vault.password_for('{} mautrix-whatsapp hs_token'.format(node.name)),
|
|
|
|
'sender_localpart': repo.vault.password_for('{} mautrix-whatsapp sender_localpart'.format(node.name)),
|
|
|
|
'provisioning': {
|
|
|
|
'enabled': False,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'postgresql': {
|
|
|
|
'roles': {
|
|
|
|
'mautrix-whatsapp': {
|
|
|
|
'password': repo.vault.password_for('{} postgresql mautrix-whatsapp'.format(node.name)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'databases': {
|
|
|
|
'mautrix-whatsapp': {
|
|
|
|
'owner': 'mautrix-whatsapp',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-07-17 08:17:39 +00:00
|
|
|
'zfs': {
|
|
|
|
'datasets': {
|
|
|
|
'tank/mautrix-whatsapp': {
|
|
|
|
'mountpoint': '/opt/mautrix-whatsapp',
|
2021-07-17 17:40:41 +00:00
|
|
|
'needed_by': {
|
|
|
|
'directory:/opt/mautrix-whatsapp',
|
|
|
|
},
|
2021-07-17 08:17:39 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-12-31 11:18:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-07 17:44:38 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'icinga2_api/mautrix-whatsapp/services',
|
|
|
|
)
|
2020-12-31 11:18:34 +00:00
|
|
|
def icinga_check_for_new_release(metadata):
|
|
|
|
return {
|
|
|
|
'icinga2_api': {
|
|
|
|
'mautrix-whatsapp': {
|
|
|
|
'services': {
|
|
|
|
'MAUTRIX-WHATSAPP UPDATE': {
|
|
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release tulir/mautrix-whatsapp {}'.format(metadata.get('mautrix-whatsapp/version')),
|
|
|
|
'vars.notification.mail': True,
|
|
|
|
'check_interval': '60m',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|