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

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