community.windows
community.windows copied to clipboard
win_scheduled_task: Unable to disable the task just with the job name
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
ISSUE TYPE
- Bug Report
COMPONENT NAME
- win_scheduled_task
ANSIBLE VERSION
Name: ansible
Version: 5.8.0
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: [email protected]
License: GPLv3+
Location: /usr/local/lib/python3.8/dist-packages
Requires: ansible-core
Required-by:
COLLECTION VERSION
# /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
Raised a doc bug fix via PR https://github.com/ansible-collections/community.windows/pull/447
@Udayendu For me with path defined it leads to the next problem: #22