Ansible win_scheduled_task how to start a task immediately

  ansible, autodesk, windows

help with advice please!

there is a program located in the path C:Program Files(x86)Common FilesAutodesk SharedAdskLicensingCurrenthelperAdskLicensingInstHelper.exe

and it must be run with the parameters ‘register -pk 829L1 -pv 2020.0.0.F -cf " srvdeploy$RVT20Imgx64RVTRevitConfig.pit" -el EN’

I decided to do it through the task scheduler
but did not find in the documentation how to start the task immediately after it was added.

- name: recover ADSKLic Service
      win_scheduled_task:
        name: ADSK
        description: RecADSK
        actions:
        - path: 'C:Program Files(x86)Common FilesAutodesk SharedAdskLicensingCurrenthelperAdskLicensingInstHelper.exe'
          arguments: register -pk 829L1 -pv 2020.0.0.F -cf "srvdeploy$RVT20Imgx64RVTRevitConfig.pit" -el EN
        triggers:
        - type: registration
        frequency: once
        state: present
        enabled: yes
        username: SYSTEM
      tags: rev, adsk, task

the task is being added, but how to start it immediately after adding it?

it may of course be easier to run .exe via win_command or raw
but it doesn’t work for me …

Source: Windows Questions

LEAVE A COMMENT