bundles/{systemd,hostname}: add hostname control

This commit is contained in:
Franzi 2020-03-27 12:46:10 +00:00
parent ae82e9cd51
commit 6656a0864f
Signed by: kunsi
GPG key ID: 12E3D2136B818350
6 changed files with 28 additions and 2 deletions

View 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

View file

@ -0,0 +1,7 @@
# TODO support non-systemd systems
files = {
'/etc/hosts': {
'content_type': 'mako',
},
}

View file

@ -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',
},
},
}

View file

@ -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.

View file

@ -4,7 +4,9 @@ groups['all'] = {
),
'bundles': {
'apt',
'hostname',
'sudo',
'systemd',
'users',
},
'metadata': {

View file

@ -2,7 +2,6 @@ nodes['htz.ex42-1048908'] = {
'bundles': [
'nginx',
'riot-web',
'systemd',
'vmhost',
'voc-loudness-monitor',
],