Creating Scheduled task in windows

I am trying to create config that will install a scheduled task. The code as far as I was aware had been working for some time and I just needed to add some more, then the pain started.

I am getting an error message
“msg”: "failed to set trigger property ‘Repetition’ to ‘System.Collections.Hashtable’: Index was outside the bounds of the array

The relevant element of the code

triggers:
  - type: daily
    start_boundary: "{{MyVariable}}"
    repetition:
       - interval: PT3H

I have tried with and without the leading - in front of the interval

My concerns

  1. Repetition is not set its repetition, so is something changing the case somewhere?
  2. What does the error actually mean?

I have followed community.windows.win_scheduled_task module – Manage scheduled tasks — Ansible Documentation

I am about 3 days in trying to understand/fix various issues this is the latest.

I am keen to be pointed towards some useful document that will explain as google has not been fruitful to date.

Thanks

Hi, not tested on my side, but according to the documentation, repetition seems to be dict instead of list. So could you please try this:

triggers:
  - type: daily
    start_boundary: "{{MyVariable}}"
    repetition:
       # - interval: PT3H
       interval: PT3H
1 Like