cleanup some more kunsi leftovers
This commit is contained in:
parent
4c55f0878d
commit
2c6073854b
4 changed files with 8 additions and 16 deletions
|
@ -1,4 +1,8 @@
|
||||||
127.0.0.1 localhost ${node.name} ${node.metadata['hostname']}
|
% if node.metadata.get('hostname', None):
|
||||||
|
127.0.0.1 localhost ${node.name} ${node.metadata.get('hostname')}
|
||||||
|
% else:
|
||||||
|
127.0.0.1 localhost ${node.name}
|
||||||
|
% endif
|
||||||
|
|
||||||
::1 ip6-localhost
|
::1 ip6-localhost
|
||||||
fe00::0 ip6-localnet
|
fe00::0 ip6-localnet
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
timezone = node.metadata.get('timezone', 'UTC')
|
timezone = node.metadata.get('timezone', 'UTC')
|
||||||
|
hostname = node.metadata.get('hostname', node.name)
|
||||||
|
|
||||||
actions = {
|
actions = {
|
||||||
'systemd-reload': {
|
'systemd-reload': {
|
||||||
|
@ -10,8 +11,8 @@ actions = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'systemd-hostname': {
|
'systemd-hostname': {
|
||||||
'command': 'hostnamectl set-hostname {}'.format(node.metadata['hostname']),
|
'command': 'hostnamectl set-hostname {}'.format(hostname),
|
||||||
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(node.metadata['hostname']),
|
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(hostname),
|
||||||
# Provided by bundle:basic
|
# Provided by bundle:basic
|
||||||
'needs': {
|
'needs': {
|
||||||
'file:/etc/hosts',
|
'file:/etc/hosts',
|
||||||
|
|
|
@ -5,10 +5,4 @@ groups['all'] = {
|
||||||
'subgroups': {
|
'subgroups': {
|
||||||
'linux',
|
'linux',
|
||||||
},
|
},
|
||||||
'metadata': {
|
|
||||||
# XXX remove this once we're no longer symlinking kunsis bundles
|
|
||||||
'icinga_options': {
|
|
||||||
'exclude_from_monitoring': True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
7
nodes.py
7
nodes.py
|
@ -7,10 +7,3 @@ from bundlewrap.metadata import atomic
|
||||||
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
|
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
|
||||||
with open(node, 'r') as f:
|
with open(node, 'r') as f:
|
||||||
exec(f.read())
|
exec(f.read())
|
||||||
|
|
||||||
for name, data in nodes.items():
|
|
||||||
if 'hostname' not in data.keys():
|
|
||||||
data['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'
|
|
||||||
|
|
||||||
if 'hostname' not in data['metadata'].keys():
|
|
||||||
data['metadata']['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'
|
|
||||||
|
|
Loading…
Reference in a new issue