move default values to libs/defaults

This commit is contained in:
Franzi 2021-06-03 18:27:45 +02:00
parent 5369490b79
commit 0a7e5bcdcd
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 11 additions and 11 deletions

View file

@ -47,10 +47,10 @@ telegraf_config = {
}, },
'outputs': { 'outputs': {
'influxdb_v2': [{ 'influxdb_v2': [{
'urls': [node.metadata['telegraf']['influxdb_url']], 'urls': [node.metadata.get('telegraf/influxdb_url', repo.libs.defaults.influxdb_url)],
'token': node.metadata['telegraf']['influxdb_token'], 'token': node.metadata.get('telegraf/influxdb_token', repo.vault.decrypt(repo.libs.defaults.influxdb_token)),
'organization': node.metadata['telegraf']['influxdb_org'], 'organization': node.metadata.get('telegraf/influxdb_org', repo.vault.decrypt(repo.libs.defaults.influxdb_org)),
'bucket': node.metadata['telegraf']['influxdb_bucket'], 'bucket': node.metadata.get('telegraf/influxdb_bucket', repo.vault.decrypt(repo.libs.defaults.influxdb_bucket)),
}], }],
}, },
} }

View file

@ -33,7 +33,7 @@ groups['linux'] = {
'metadata': { 'metadata': {
'apt': { 'apt': {
'unattended-upgrades': { 'unattended-upgrades': {
'mail': 'hostmaster@kunsmann.eu', 'mail': libs.defaults.hostmaster_email,
}, },
}, },
'backup-client': { 'backup-client': {
@ -49,12 +49,6 @@ groups['linux'] = {
}, },
}, },
}, },
'telegraf': {
'influxdb_url': 'https://influxdb.kunsmann.eu/',
'influxdb_token': vault.decrypt('encrypt$gAAAAABgg9Ag632Xyuc6SWXaR1uH2tLOChmVKAoBIikhjntSSD2qJFL_eouVQGXCLH2HEuSbSdEXcTPn2qmhOiA9jmFdoDSbVbQUsp0EID1wLsWYG_Um2KOxZSF-tn9eDZlgShQYySjzO3nQRmdlJpVLUnGHsiwv_sHD2FstXGpfzTPZq5_egUqEc0K2X-aN2J6BTYc2fZAN'),
'influxdb_org': vault.decrypt('encrypt$gAAAAABgg9hyjz4XtvG8NBw9uYxiumS3v7YKIrtc9tTTABg1f9R22gzn55q8ULP9X3wlsPMUQs_DH7CgGv9neYmvVAriRoyd8g=='),
'influxdb_bucket': vault.decrypt('encrypt$gAAAAABgg9iMnq0nKpODMiMN4NtUw231iqpbyDXV-O8epOAGDSL4jcf3CaSa2bLZzH2fJFaKWjW-dpVd384x6KqSQU19XpfsWA=='),
},
}, },
'pip_command': 'pip3', 'pip_command': 'pip3',
} }

6
libs/defaults.py Normal file
View file

@ -0,0 +1,6 @@
hostmaster_email = 'hostmaster@kunbox.net'
influxdb_bucket = 'encrypt$gAAAAABgg9iMnq0nKpODMiMN4NtUw231iqpbyDXV-O8epOAGDSL4jcf3CaSa2bLZzH2fJFaKWjW-dpVd384x6KqSQU19XpfsWA=='
influxdb_org = 'encrypt$gAAAAABgg9hyjz4XtvG8NBw9uYxiumS3v7YKIrtc9tTTABg1f9R22gzn55q8ULP9X3wlsPMUQs_DH7CgGv9neYmvVAriRoyd8g=='
influxdb_token = 'encrypt$gAAAAABgg9Ag632Xyuc6SWXaR1uH2tLOChmVKAoBIikhjntSSD2qJFL_eouVQGXCLH2HEuSbSdEXcTPn2qmhOiA9jmFdoDSbVbQUsp0EID1wLsWYG_Um2KOxZSF-tn9eDZlgShQYySjzO3nQRmdlJpVLUnGHsiwv_sHD2FstXGpfzTPZq5_egUqEc0K2X-aN2J6BTYc2fZAN'
influxdb_url = 'https://influxdb.kunsmann.eu/'