bundles/{systemd,hostname}: add hostname control
This commit is contained in:
parent
ae82e9cd51
commit
6656a0864f
6 changed files with 28 additions and 2 deletions
8
bundles/hostname/files/hosts
Normal file
8
bundles/hostname/files/hosts
Normal file
|
@ -0,0 +1,8 @@
|
|||
127.0.0.1 localhost localhost.localdomain ${node.hostname}
|
||||
|
||||
::1 ip6-localhost
|
||||
fe00::0 ip6-localnet
|
||||
ff00::0 ip6-mcastprefix
|
||||
ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
||||
ff02::3 ip6-allhosts
|
7
bundles/hostname/items.py
Normal file
7
bundles/hostname/items.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
# TODO support non-systemd systems
|
||||
|
||||
files = {
|
||||
'/etc/hosts': {
|
||||
'content_type': 'mako',
|
||||
},
|
||||
}
|
|
@ -3,5 +3,16 @@ actions = {
|
|||
'command': '/usr/bin/systemctl daemon-reload',
|
||||
'cascade_skip': False,
|
||||
'triggered': True,
|
||||
'needed_by': {
|
||||
'svc_systemd:',
|
||||
},
|
||||
},
|
||||
'systemd-hostname': {
|
||||
'command': 'hostnamectl set-hostname {}'.format(node.hostname),
|
||||
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(node.hostname),
|
||||
# Provided by 'hostname' bundle
|
||||
'needs': {
|
||||
'file:/etc/hosts',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -69,7 +69,6 @@ for stream_id, config in streams.items():
|
|||
svc_systemd['loudness_{}'.format(stream_id)] = {
|
||||
'needs': {
|
||||
'file:/etc/systemd/system/loudness_{}.service'.format(stream_id),
|
||||
'action:systemd-reload',
|
||||
},
|
||||
# These units are designed to fail if the assigned stream fails. No need
|
||||
# to restart them on every bw run.
|
||||
|
|
|
@ -4,7 +4,9 @@ groups['all'] = {
|
|||
),
|
||||
'bundles': {
|
||||
'apt',
|
||||
'hostname',
|
||||
'sudo',
|
||||
'systemd',
|
||||
'users',
|
||||
},
|
||||
'metadata': {
|
||||
|
|
|
@ -2,7 +2,6 @@ nodes['htz.ex42-1048908'] = {
|
|||
'bundles': [
|
||||
'nginx',
|
||||
'riot-web',
|
||||
'systemd',
|
||||
'vmhost',
|
||||
'voc-loudness-monitor',
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue