nodes.py: autogenerate hostname if not set in nodefile

This commit is contained in:
Franzi 2020-03-27 12:28:37 +00:00
parent 067b498bf2
commit ae82e9cd51
Signed by: kunsi
GPG Key ID: 12E3D2136B818350
3 changed files with 4 additions and 2 deletions

View File

@ -5,3 +5,7 @@ nodes = {}
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
with open(node, 'r') as f:
exec(f.read())
for name, data in nodes.items():
if 'hostname' not in data.keys():
data['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'

View File

@ -1,5 +1,4 @@
nodes['htz-cloud.pirmasens'] = {
'hostname': '195.201.90.143',
'bundles': [
],
'metadata': {

View File

@ -1,5 +1,4 @@
nodes['htz.ex42-1048908'] = {
'hostname': '94.130.52.224',
'bundles': [
'nginx',
'riot-web',