better config change detection

This commit is contained in:
Emmanuel Garette 2022-10-17 18:52:42 +02:00
parent 8895c3ee9e
commit 14a2cc65f9

View file

@ -30,21 +30,30 @@ def fileslist(data, is_host=False, name_only=False, prefix=None):
prefix, prefix,
) )
for service, service_data in data.items(): for service, service_data in data.items():
if service_data['activate'] and service_data['engine'] != 'none': if not service_data['activate']:
_add(files, if service_data['engine'] == 'none' and service_data['type'] == 'service' and not 'overrides' in service_data:
{'owner': 'root', 'group': 'root', 'mode': '0755'},
base_systemd + '/systemd/system/' + service_data['doc'],
name_only,
prefix,
)
if service_data['activate'] and 'overrides' in service_data:
for override_data in service_data['overrides'].values():
_add(files, _add(files,
{'owner': 'root', 'group': 'root', 'mode': '0755'}, {'owner': 'root', 'group': 'root', 'mode': '0755'},
base_systemd + '/systemd/system/' + override_data['name'] + '.d/rougail.conf', base_systemd + '/systemd/system/' + service_data['doc'],
name_only, name_only,
prefix, prefix,
) )
else:
if service_data['activate'] and service_data['engine'] != 'none':
_add(files,
{'owner': 'root', 'group': 'root', 'mode': '0755'},
base_systemd + '/systemd/system/' + service_data['doc'],
name_only,
prefix,
)
if service_data['activate'] and 'overrides' in service_data:
for override_data in service_data['overrides'].values():
_add(files,
{'owner': 'root', 'group': 'root', 'mode': '0755'},
base_systemd + '/systemd/system/' + override_data['name'] + '.d/rougail.conf',
name_only,
prefix,
)
if 'files' not in service_data: if 'files' not in service_data:
continue continue
for file_data in service_data['files'].values(): for file_data in service_data['files'].values():