Your “hosts” line needs to be before the - name line.

Harry

On Wed, May 13, 2020 at 6:37 PM Tony Wong <[email protected]> wrote:

> ---
> - name: Install all critical and security updates
>   hosts: all
>   win_updates:
>     category_names:
>     - CriticalUpdates
>     - SecurityUpdates
>     state: installed
>   register: update_result
>
> - name: Reboot host if required
>   win_reboot:
>   when: update_result.reboot_required
>
>
>
>
> but getting this
>
>
> ERROR! 'win_updates' is not a valid attribute for a Play
>
> The error appears to be in
> '/home/tony/windows/install_windows_updates.yml': line 2, column 3, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> ---
> - name: Install all critical and security updates
>   ^ here
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/ad2e6e39-2858-42dc-836a-9edb29f22736%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ad2e6e39-2858-42dc-836a-9edb29f22736%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CALYKJ24mh2PodagyQFM%3DtezR_Mhde0roun5wQi%2B3NPFxa79_pg%40mail.gmail.com.

Reply via email to