add bundle:sysctl
This commit is contained in:
parent
8d21e15106
commit
95856a2c2d
10 changed files with 79 additions and 0 deletions
3
bundles/sysctl/files/99-sysctl.conf
Normal file
3
bundles/sysctl/files/99-sysctl.conf
Normal 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
31
bundles/sysctl/items.py
Normal 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',
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue