2021-02-18 16:56:06 +00:00
|
|
|
timezone = node.metadata.get('timezone', 'UTC')
|
|
|
|
|
2020-03-21 11:31:56 +00:00
|
|
|
actions = {
|
|
|
|
'systemd-reload': {
|
2020-09-22 16:11:09 +00:00
|
|
|
'command': 'systemctl daemon-reload',
|
2020-03-21 11:31:56 +00:00
|
|
|
'cascade_skip': False,
|
|
|
|
'triggered': True,
|
2020-03-27 12:46:10 +00:00
|
|
|
'needed_by': {
|
|
|
|
'svc_systemd:',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'systemd-hostname': {
|
2020-10-25 10:07:23 +00:00
|
|
|
'command': 'hostnamectl set-hostname {}'.format(node.metadata['hostname']),
|
|
|
|
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(node.metadata['hostname']),
|
2021-01-23 11:05:59 +00:00
|
|
|
# Provided by bundle:basic
|
2020-03-27 12:46:10 +00:00
|
|
|
'needs': {
|
|
|
|
'file:/etc/hosts',
|
|
|
|
},
|
2020-03-21 11:31:56 +00:00
|
|
|
},
|
2020-11-13 22:26:13 +00:00
|
|
|
'systemd-timezone': {
|
2021-02-18 16:56:06 +00:00
|
|
|
'command': 'timedatectl set-timezone {}'.format(timezone),
|
|
|
|
'unless': 'timedatectl status | grep -Fi \'time zone\' | grep -i \'{}\''.format(timezone.lower()),
|
2020-11-13 22:26:13 +00:00
|
|
|
},
|
|
|
|
'systemd-enable-ntp': {
|
|
|
|
'command': 'timedatectl set-ntp true',
|
|
|
|
'unless': 'timedatectl status | grep -Fi \'ntp service\' | grep -i \'active\'',
|
|
|
|
},
|
2020-03-21 11:31:56 +00:00
|
|
|
}
|
2020-12-12 09:39:57 +00:00
|
|
|
|
|
|
|
files = {
|
|
|
|
'/etc/systemd/journald.conf': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
2021-02-18 17:12:25 +00:00
|
|
|
'journal': node.metadata.get('systemd/journal', {}),
|
2020-12-12 09:39:57 +00:00
|
|
|
},
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:systemd-journald:restart',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
svc_systemd = {
|
|
|
|
'systemd-journald': {
|
|
|
|
'needs': {
|
|
|
|
'file:/etc/systemd/journald.conf',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|