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

1,765 views
Skip to first unread message

Abhishek Mishra

unread,
Oct 14, 2018, 12:53:35 AM10/14/18
to Ansible Project
ERROR! 'win_updates' is not a valid attribute for a Play

My yaml file

-

  name: "Install all security updates with automatic reboots"

  win_updates:

    category_names:

      - SecurityUpdates

    reboot: true



ERROR msg while running


[asadmin@ansible Playbook]$ ansible-playbook winupdate.yaml -i windowsinventory.txt

ERROR! 'win_updates' is not a valid attribute for a Play


The error appears to have been in '/home/asadmin/test_project/Playbook/winupdate.yaml': 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 security updates with automatic reboots"

  ^ here

Justin Schmitz

unread,
Oct 14, 2018, 5:07:23 AM10/14/18
to ansible...@googlegroups.com
Your name needs to start with


- name: "Install all security updates with     automatic reboots"

  win_updates:

    category_names:

      - SecurityUpdates

    reboot: true



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fbdbac99-2f41-49b8-99f9-bd23c9ec1ac6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Abhishek Mishra

unread,
Oct 14, 2018, 8:18:01 AM10/14/18
to ansible...@googlegroups.com
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

Justin Schmitz

unread,
Oct 14, 2018, 8:22:19 AM10/14/18
to ansible...@googlegroups.com
Your syntax is incorrect. There is nothing extra needing to be installed. Have a look at the examples from the documentation. 

Thanks

Jordan Borean

unread,
Oct 14, 2018, 6:14:52 PM10/14/18
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages