2020-03-27 11:52:17 +00:00
|
|
|
groups = {
|
|
|
|
'sudo': {},
|
|
|
|
}
|
|
|
|
|
2020-11-09 19:39:35 +00:00
|
|
|
directories = {
|
|
|
|
'/etc/sudoers.d': {
|
|
|
|
'purge': True,
|
2022-07-25 08:08:26 +00:00
|
|
|
'after': {
|
|
|
|
'pkg_apt:',
|
|
|
|
},
|
2020-11-09 19:39:35 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-03-27 11:52:17 +00:00
|
|
|
files = {
|
|
|
|
'/etc/sudoers': {
|
2021-01-23 08:28:50 +00:00
|
|
|
'mode': '0440',
|
2020-11-09 19:39:35 +00:00
|
|
|
'needs': {
|
|
|
|
'file:/etc/sudoers.d/bwusers',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/sudoers.d/bwusers': {
|
2020-03-27 11:52:17 +00:00
|
|
|
'content_type': 'mako',
|
|
|
|
},
|
|
|
|
}
|
2021-05-23 10:24:00 +00:00
|
|
|
|
|
|
|
for filename, content in node.metadata.get('sudo/extra_configs', {}).items():
|
|
|
|
files[f'/etc/sudoers.d/{filename}'] = {
|
|
|
|
'content': '\n'.join(sorted(content)) + '\n',
|
|
|
|
'mode': '0440',
|
|
|
|
}
|