ERROR! 'win_updates' is not a valid attribute for a Play. Pls suggest

ERROR! ‘win_updates’ is not a valid attribute for a Play

My yaml file

Your name needs to start with

  • name: “Install all security updates with automatic reboots”

win_updates:

category_names:

  • SecurityUpdates

reboot: true

Is any module or plugin required for win_update ?
Still getting same message. ‘win_updates’ is not a valid attribute for a Play

  • name: “Install all security updates with automatic reboots”

win_updates:

category_names:

  • SecurityUpdates

reboot: true

Your syntax is incorrect. There is nothing extra needing to be installed. Have a look at the examples from the documentation.

Thanks

Sounds like you are trying to call a list of tasks directly with ‘ansible-playbook’ rather than a playbook. Have a read through https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#playbook-language-example to see how to write a playbook that contains variaous tasks. Once you are comfortable with this you can start to move onto roles which are highly recommended.

Thanks

Jordan