ansible.builtin.win_scheduled_task (v2.3.0.0-1) — module

Manage scheduled tasks

| "added in version" 2.0 of ansible.builtin"

Authors: Peter Mounce

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.0.0.post1

Description

Manage scheduled tasks

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a scheduled task to open a command prompt
- win_scheduled_task:
    name: TaskName
    description: open command prompt
    executable: cmd
    arguments: -opt1 -opt2
    path: example
    time: 9am
    frequency: daily
    state: present
    enabled: yes
    user: SYSTEM

Inputs

    
name:
    description:
    - Name of the scheduled task
    required: true

path:
    default: \
    description:
    - Task folder in which this task will be stored

time:
    description:
    - Time to execute scheduled task, not idempotent

user:
    description:
    - User to run scheduled task as

state:
    choices:
    - present
    - absent
    description:
    - State that the task should become
    required: true

enabled:
    choices:
    - true
    - false
    default: true
    description:
    - Enable/disable the task

arguments:
    aliases:
    - argument
    description:
    - Arguments to provide scheduled task action

frequency:
    choices:
    - once
    - daily
    - weekly
    description:
    - The frequency of the command, not idempotent

executable:
    aliases:
    - execute
    description:
    - Command the scheduled task should execute

description:
    description:
    - The description for the scheduled task

days_of_week:
    description:
    - Days of the week to run a weekly task, not idempotent