2021-05-02 08:44:50 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
'grafana': {},
|
|
|
|
},
|
|
|
|
'repos': {
|
|
|
|
'grafana': {
|
|
|
|
'items': {
|
|
|
|
'deb https://packages.grafana.com/oss/deb stable main',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-05-19 18:56:34 +00:00
|
|
|
'backups': {
|
|
|
|
'paths': {
|
|
|
|
'/var/lib/grafana',
|
|
|
|
},
|
|
|
|
},
|
2021-05-02 08:44:50 +00:00
|
|
|
'grafana': {
|
|
|
|
'allow_anonymous': False,
|
|
|
|
'allow_embedding': False,
|
|
|
|
'allow_sign_up': False,
|
|
|
|
'anonymous_org': 'public',
|
|
|
|
'enable_smtp': True,
|
|
|
|
'login_max_duration': '24h',
|
|
|
|
'secret_key': repo.vault.random_bytes_as_base64_for(f'{node.name} grafana secret_key'),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
|
|
'nginx/vhosts/grafana',
|
|
|
|
)
|
|
|
|
def nginx(metadata):
|
|
|
|
if not node.has_bundle('nginx'):
|
|
|
|
raise DoNotRunAgain
|
|
|
|
|
|
|
|
return {
|
|
|
|
'nginx': {
|
|
|
|
'vhosts': {
|
|
|
|
'grafana': {
|
|
|
|
'domain': metadata.get('grafana/domain'),
|
2021-07-04 18:10:19 +00:00
|
|
|
'locations': {
|
2021-05-02 08:44:50 +00:00
|
|
|
'/': {
|
|
|
|
'target': 'http://127.0.0.1:21010',
|
|
|
|
},
|
2021-08-07 18:02:57 +00:00
|
|
|
'/api/ds/query': {
|
|
|
|
'target': 'http://127.0.0.1:21010',
|
|
|
|
'proxy_read_timeout': 300,
|
|
|
|
},
|
2021-05-02 08:44:50 +00:00
|
|
|
},
|
|
|
|
'website_check_path': '/login',
|
|
|
|
'website_check_string': 'Grafana',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|