2021-07-04 14:36:43 +00:00
|
|
|
defaults = {
|
2021-07-04 18:15:19 +00:00
|
|
|
'backups': {
|
|
|
|
'paths': {
|
|
|
|
'/opt/matrix-dimension',
|
|
|
|
'/var/opt/matrix-dimension',
|
|
|
|
},
|
|
|
|
},
|
2021-07-17 11:05:56 +00:00
|
|
|
'icinga2_api': {
|
|
|
|
'matrix-dimension': {
|
|
|
|
'services': {
|
|
|
|
'MATRIX-DIMENSION PROCESS': {
|
|
|
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -a matrix-dimension -c 1:',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-07-04 14:36:43 +00:00
|
|
|
'matrix-dimension': {
|
|
|
|
'install_dir': '/opt/matrix-dimension',
|
2021-07-04 16:04:48 +00:00
|
|
|
'data_dir': '/var/opt/matrix-dimension',
|
2021-07-04 14:36:43 +00:00
|
|
|
'database': {
|
|
|
|
'user': 'matrix-dimension',
|
|
|
|
'password': repo.vault.password_for('{} postgresql matrix-dimension'.format(node.name)),
|
|
|
|
'database': 'matrix-dimension',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'postgresql': {
|
|
|
|
'roles': {
|
|
|
|
'matrix-dimension': {
|
|
|
|
'password': repo.vault.password_for('{} postgresql matrix-dimension'.format(node.name)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'databases': {
|
|
|
|
'matrix-dimension': {
|
|
|
|
'owner': 'matrix-dimension',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-07-04 16:04:48 +00:00
|
|
|
'users': {
|
2021-07-04 18:38:27 +00:00
|
|
|
'matrix-dimension': {
|
2021-07-04 16:04:48 +00:00
|
|
|
'home': '/var/opt/matrix-dimension',
|
2021-07-04 14:36:43 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-07-23 17:53:49 +00:00
|
|
|
|
2021-07-04 14:36:43 +00:00
|
|
|
@metadata_reactor.provides(
|
2021-07-04 18:58:56 +00:00
|
|
|
'nginx/vhosts/matrix-dimension',
|
2021-07-04 14:36:43 +00:00
|
|
|
)
|
|
|
|
def nginx_config(metadata):
|
|
|
|
return {
|
|
|
|
'nginx': {
|
|
|
|
'vhosts': {
|
2021-07-04 18:58:56 +00:00
|
|
|
'matrix-dimension': {
|
|
|
|
'domain': metadata.get('matrix-dimension/url'),
|
2021-07-04 14:36:43 +00:00
|
|
|
'do_not_set_content_security_headers': True,
|
|
|
|
'max_body_size': '50M',
|
2021-07-04 18:15:19 +00:00
|
|
|
'locations': {
|
2021-07-04 14:36:43 +00:00
|
|
|
'/': {
|
2021-07-04 19:32:10 +00:00
|
|
|
'target': 'http://127.0.0.1:20030',
|
2021-07-04 14:36:43 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-23 17:53:49 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'zfs/datasets',
|
|
|
|
)
|
|
|
|
def zfs(metadata):
|
|
|
|
return {
|
|
|
|
'zfs': {
|
|
|
|
'datasets': {
|
|
|
|
'tank/matrix-dimension': {},
|
|
|
|
'tank/matrix-dimension/install': {
|
|
|
|
'mountpoint': metadata.get('matrix-dimension/install_dir'),
|
|
|
|
'needed_by': {
|
|
|
|
'directory:{}'.format(metadata.get('matrix-dimension/install_dir')),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'tank/matrix-dimension/var': {
|
|
|
|
'mountpoint': metadata.get('matrix-dimension/data_dir'),
|
|
|
|
'needed_by': {
|
|
|
|
'directory:{}'.format(metadata.get('matrix-dimension/data_dir')),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-17 11:05:56 +00:00
|
|
|
# XXX enable this once there are releases for matrix-dimension
|
|
|
|
#@metadata_reactor.provides(
|
|
|
|
# 'icinga2_api/matrix-dimension/services',
|
|
|
|
#)
|
|
|
|
#def icinga_check_for_new_release(metadata):
|
|
|
|
# return {
|
|
|
|
# 'icinga2_api': {
|
|
|
|
# 'matrix-dimension': {
|
|
|
|
# 'services': {
|
|
|
|
# 'MATRIX-DIMENSION UPDATE': {
|
|
|
|
# 'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release turt2live/matrix-dimension {}'.format(metadata.get('matrix-dimension/version')),
|
|
|
|
# 'vars.notification.mail': True,
|
|
|
|
# 'check_interval': '60m',
|
|
|
|
# },
|
|
|
|
# },
|
|
|
|
# },
|
|
|
|
# },
|
|
|
|
# }
|