68 lines
1.8 KiB
Python
68 lines
1.8 KiB
Python
from bundlewrap.metadata import atomic
|
|
|
|
defaults = {
|
|
'apt': {
|
|
'packages': {
|
|
'autoconf': {},
|
|
'bluez': {},
|
|
'build-essential': {},
|
|
'libffi-dev': {},
|
|
'libjpeg-dev': {},
|
|
'libopenjp2-7': {},
|
|
'libssl-dev': {},
|
|
'libtiff5': {},
|
|
'libturbojpeg0-dev': {},
|
|
'python3-packaging': {},
|
|
'tzdata': {},
|
|
'zlib1g-dev': {},
|
|
},
|
|
},
|
|
'backups': {
|
|
'paths': {
|
|
'/opt/homeassistant',
|
|
'/var/opt/homeassistant',
|
|
},
|
|
},
|
|
}
|
|
@metadata_reactor.provides(
|
|
'icinga2_api/homeassistant/services/HOMESSISTANT UPDATE',
|
|
)
|
|
def icinga_check_for_new_release(metadata):
|
|
return {
|
|
'icinga2_api': {
|
|
'homeassistant': {
|
|
'services': {
|
|
'HOMEASSISTANT UPDATE': {
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_homeassistant_update',
|
|
'vars.notification.mail': True,
|
|
'check_interval': '60m',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
@metadata_reactor.provides(
|
|
'nginx/vhosts/homeassistant',
|
|
)
|
|
def nginx(metadata):
|
|
if not node.has_bundle('nginx'):
|
|
raise DoNotRunAgain
|
|
|
|
return {
|
|
'nginx': {
|
|
'vhosts': {
|
|
'homeassistant': {
|
|
'domain': metadata.get('homeassistant/domain'),
|
|
'website_check_path': '/',
|
|
'website_check_string': 'Homeassistant',
|
|
'locations': {
|
|
'/': {
|
|
'target': 'http://127.0.0.1:8123',
|
|
'websockets': True,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|