add bundle:sysctl

This commit is contained in:
Franzi 2021-06-04 07:27:49 +02:00
parent 8d21e15106
commit 95856a2c2d
Signed by: kunsi
GPG key ID: 12E3D2136B818350
10 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,3 @@
% for option, value in sorted(node.metadata.get('sysctl/options', {}).items()):
${option}=${value}
% endfor

31
bundles/sysctl/items.py Normal file
View file

@ -0,0 +1,31 @@
files = {
'/usr/local/sbin/apply-sysctl': {
'content':
'#!/bin/sh\n'
'\n'
'cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -',
'mode': '0700',
},
'/etc/sysctl.d/99-sysctl.conf': {
'content_type': 'mako',
},
}
directories = {
'/etc/sysctl.d': {
'purge': True,
'triggers': {
'action:apply-sysctl-settings',
},
},
}
actions = {
'apply-sysctl-settings': {
'command': '/usr/local/sbin/apply-sysctl',
'triggered': True,
'needs': {
'file:/usr/local/sbin/apply-sysctl',
},
},
}