2021-12-21 14:56:24 +00:00
|
|
|
timezone = node.metadata.get('timezone', 'UTC')
|
2021-12-22 06:41:50 +00:00
|
|
|
hostname = node.metadata.get('hostname', node.name)
|
2021-12-21 14:56:24 +00:00
|
|
|
|
|
|
|
actions = {
|
|
|
|
'systemd-reload': {
|
|
|
|
'command': 'systemctl daemon-reload',
|
|
|
|
'cascade_skip': False,
|
|
|
|
'triggered': True,
|
|
|
|
'needed_by': {
|
|
|
|
'svc_systemd:',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'systemd-hostname': {
|
2021-12-22 06:41:50 +00:00
|
|
|
'command': 'hostnamectl set-hostname {}'.format(hostname),
|
|
|
|
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(hostname),
|
2021-12-21 14:56:24 +00:00
|
|
|
# Provided by bundle:basic
|
|
|
|
'needs': {
|
|
|
|
'file:/etc/hosts',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'systemd-timezone': {
|
|
|
|
'command': 'timedatectl set-timezone {}'.format(timezone),
|
|
|
|
'unless': 'timedatectl status | grep -Fi \'time zone\' | grep -i \'{}\''.format(timezone.lower()),
|
|
|
|
},
|
|
|
|
'systemd-enable-ntp': {
|
|
|
|
'command': 'timedatectl set-ntp true',
|
|
|
|
'unless': 'timedatectl status | grep -Fi \'ntp service\' | grep -i \'active\'',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
files = {
|
|
|
|
'/etc/systemd/journald.conf': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
|
|
|
'journal': node.metadata.get('systemd/journal', {}),
|
|
|
|
},
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:systemd-journald:restart',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
svc_systemd = {
|
|
|
|
'systemd-journald': {
|
|
|
|
'needs': {
|
|
|
|
'file:/etc/systemd/journald.conf',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|