bundlewrap/bundles/sudo/items.py

31 lines
573 B
Python
Raw Permalink Normal View History

2020-03-27 11:52:17 +00:00
groups = {
'sudo': {},
}
2020-11-09 19:39:35 +00:00
directories = {
'/etc/sudoers.d': {
'purge': True,
'after': {
'pkg_apt:',
},
2020-11-09 19:39:35 +00:00
},
}
2020-03-27 11:52:17 +00:00
files = {
'/etc/sudoers': {
'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',
},
}
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',
}