salt icon indicating copy to clipboard operation
salt copied to clipboard

[FEATURE REQUEST] missing state win_task

Open aarnaud opened this issue 4 years ago • 7 comments

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

aarnaud avatar Nov 27 '20 14:11 aarnaud

/cc @twangboy @cmcmarrow since they have more Windows knowledge than me

s0undt3ch avatar Dec 03 '20 08:12 s0undt3ch

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.

rvandegrift avatar Jan 29 '21 19:01 rvandegrift

or does it need to be ported to the master branch? @twangboy

sagetherage avatar Feb 16 '21 22:02 sagetherage

this would be very helpful to have

keslerm avatar Nov 11 '21 22:11 keslerm

I would love to have this in master. Anything I can do to help get this merged?

Danduriel avatar Oct 27 '22 11:10 Danduriel

Ping, does this require someone submitting a cherry-picked PR between the two branches?

DaAwesomeP avatar Jan 20 '23 22:01 DaAwesomeP

I agree, this is a very useful feature. Any chance of having this?

emnavarro02 avatar Feb 02 '24 14:02 emnavarro02