mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Remaining case means that the value is in configured and current, check if the value is set correctly (and return True appropriately), if not then it needs to be set
This commit is contained in:
parent
9e15a69b30
commit
6c1113bd88
@ -77,8 +77,15 @@ def present(name, value, config=None):
|
||||
ret['comment'] = 'Sysctl option {0} set to be changed to {1}'.format(name, value)
|
||||
return ret
|
||||
else:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Invalid sysctl option {0} = {1}'.format(name, value)
|
||||
if str(value) == __salt__['sysctl.get'](name):
|
||||
ret['result'] = True
|
||||
ret['comment'] = 'Sysctl value {0} = {1} is already set'.format(
|
||||
name,
|
||||
value
|
||||
)
|
||||
else:
|
||||
ret['result'] = None
|
||||
ret['comment'] = 'Sysctl option {0} set to be changed to {1}'.format(name, value)
|
||||
return ret
|
||||
|
||||
update = __salt__['sysctl.persist'](name, value, config)
|
||||
|
Loading…
Reference in New Issue
Block a user