salt
salt copied to clipboard
[FEATURE REQUEST] missing state win_task
Is your feature request related to a problem? Please describe. A module win_task exist but there is no state to call it.
Describe the solution you'd like A simple state that call that module
Additional context This module permit to manage windows schedule tasks.
Exemple of small state that I can used:
def __virtual__():
'''
Only load if the graylog module is available
'''
if 'task.create_task_from_xml' in __salt__:
return 'task'
return False
def create_folder(name, **client_args):
ret = {"name": name, "result": True, "changes": {}, "comment": ""}
ret['comment'] = __salt__['task.create_folder'](name, **client_args)
if isinstance(ret['comment'], bool) and ret['comment']:
ret['changes'][name] = "created"
return ret
def create_task_from_xml(name, **client_args):
ret = {'name': name, 'result': True, 'changes': {}, 'comment': ""}
ret['comment'] = __salt__['task.create_task_from_xml'](name, **client_args)
if isinstance(ret['comment'], bool) and ret['comment']:
ret['changes'][name] = "created"
return ret
def delete_task(name, **client_args):
ret = {'name': name, 'result': True, 'changes': {}, 'comment': ""}
ret['comment'] = __salt__['task.delete_task'](name, **client_args)
if isinstance(ret['comment'], bool) and ret['comment']:
ret['changes'][name] = "deleted"
return ret
/cc @twangboy @cmcmarrow since they have more Windows knowledge than me
There is an accepted PR for the state here: https://github.com/saltstack/salt/pull/53035 It was merged into https://github.com/saltstack/salt/tree/develop and appears to never have been released.
or does it need to be ported to the master
branch? @twangboy
this would be very helpful to have
I would love to have this in master. Anything I can do to help get this merged?
Ping, does this require someone submitting a cherry-picked PR between the two branches?
I agree, this is a very useful feature. Any chance of having this?