2021-02-12 15:01:35 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'golang-go': {},
|
|
|
|
'imagemagick': {},
|
|
|
|
'ffmpeg': {},
|
2021-02-13 07:09:48 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'backups': {
|
|
|
|
'paths': {
|
|
|
|
'/var/matrix/media',
|
2021-02-12 15:01:35 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'icinga2_api': {
|
|
|
|
'matrix-media-repo': {
|
|
|
|
'services': {
|
|
|
|
'MATRIX-MEDIA-REPO PROCESS': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -a media_repo -c 1:',
|
2021-04-10 14:40:44 +00:00
|
|
|
'vars.notification.sms': True,
|
2021-02-12 15:01:35 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'matrix-media-repo': {
|
|
|
|
'database': {
|
|
|
|
'user': 'matrix-media-repo',
|
|
|
|
'password': repo.vault.password_for('{} postgresql matrix-media-repo'.format(node.name)),
|
|
|
|
'database': 'matrix-media-repo',
|
|
|
|
},
|
|
|
|
'archive': {
|
|
|
|
'self-service': False,
|
|
|
|
},
|
|
|
|
'download_max_mb': 100,
|
|
|
|
'preview_max_mb': 10,
|
|
|
|
'shared-secret-token': repo.vault.password_for('{} matrix-media-repo shared-secret-token'.format(node.name)),
|
|
|
|
'upload_max_mb': 100,
|
|
|
|
},
|
|
|
|
'postgresql': {
|
|
|
|
'roles': {
|
|
|
|
'matrix-media-repo': {
|
|
|
|
'password': repo.vault.password_for('{} postgresql matrix-media-repo'.format(node.name)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'databases': {
|
|
|
|
'matrix-media-repo': {
|
|
|
|
'owner': 'matrix-media-repo',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
|
|
'matrix-media-repo/workers',
|
|
|
|
)
|
|
|
|
def cpu_to_workers(metadata):
|
|
|
|
return {
|
|
|
|
'matrix-media-repo': {
|
|
|
|
'workers': max(metadata.get('vm/cpu', 1), 4),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
|
|
'icinga2_api/matrix-media-repo/services',
|
|
|
|
)
|
|
|
|
def icinga_check_for_new_release(metadata):
|
|
|
|
return {
|
|
|
|
'icinga2_api': {
|
|
|
|
'matrix-media-repo': {
|
|
|
|
'services': {
|
|
|
|
'MATRIX-MEDIA-REPO UPDATE': {
|
|
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release turt2live/matrix-media-repo {}'.format(metadata.get('matrix-media-repo/version')),
|
|
|
|
'vars.notification.mail': True,
|
|
|
|
'check_interval': '60m',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|