win_scheduled_task is unable to disable the task just with the task name.
SUMMARY
win_scheduled_task is unable to disable the task just with the task name. It required the folder details as well. Hence either code fix required to check it by the task name or documentation required some explanation. Documentation
- name: Disable a task that already exists
community.windows.win_scheduled_task:
name: TaskToDisable
enabled: no
# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection Version
----------------- -------
community.windows 1.10.0
CONFIGURATION
No specific configuration
OS / ENVIRONMENT
Ubuntu 20.04 LTS
STEPS TO REPRODUCE
Use the following play to stop the scheduled task:
name: Disable a task that already exists
community.windows.win_scheduled_task:
name: TaskToDisable
enabled: no
EXPECTED RESULTS
It should stop the task as it is.
ACTUAL RESULTS
It failed to stop the scheduled task and giving the following error message:
failed: [x.x.x.x] (item=TaskToDisable) => {
"changed": false,
"item": "TaskToDisable",
"msg": "cannot create a task with no actions, set at least one action with a path to an executable"
}
The task is under TaskChecker folder. So after including the path, its working well. But without path, its not able to search the job.
- name: Disable a task that already exists
win_scheduled_task:
path: \TaskChecker
name: TaskToDisable
enabled: no
win_scheduled_task
is unable to disable the task just with the task name.SUMMARY
win_scheduled_task
is unable to disable the task just with the task name. It required the folder details as well. Hence either code fix required to check it by the task name or documentation required some explanation. DocumentationISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
It should stop the task as it is.
ACTUAL RESULTS
It failed to stop the scheduled task and giving the following error message:
The task is under
TaskChecker
folder. So after including the path, its working well. But without path, its not able to search the job.