is there a progress bar in TASK?

74 views
Skip to first unread message

Tony Wong

unread,
May 17, 2020, 1:26:50 PM5/17/20
to Ansible Project
is there a progress bar available in TASK?

Screen Shot 2020-05-17 at 10.25.19 AM.png


David Foley

unread,
May 17, 2020, 4:09:09 PM5/17/20
to Ansible Project
A Quick Google Search Returned this for me. I'll assume you did the same? 

Tony Wong

unread,
May 17, 2020, 11:34:10 PM5/17/20
to ansible...@googlegroups.com
Still dont understand why its failing

PLAY [Install updates on whitelist] *****************************************                            ***

TASK [Gathering Facts] ******************************************************                            ***
ok: [rw-ctxweb-01.wsgr.com]

TASK [Install windows updates] **********************************************                            ***
ok: [rw-ctxweb-01.wsgr.com]

TASK [reboot host if required] *************************************************
fatal: [rxxxxxxxxx]: FAILED! => {"msg": "The conditional check 'update_result.reboot_required == true' failed. The error was: error while evaluating conditional (update_result.reboot_required == true): 'update_result' is undefined\n\nThe error appears to be in '/home/tony/windows/install_windows_KBxxxxx_updates.yml': line 16, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: reboot host if required\n      ^ here\n"}



---
- name: Install updates on whitelist
  hosts: all
  tasks:
    - name: Install windows updates
      win_updates:
        category_names:
        - SecurityUpdates
        whitelist:
        - KB4541505
        server_selection: windows_update
        state: installed
        log_path: c:\ansible_wu.txt
        register: update_result

    - name: reboot host if required
      win_reboot:
      when: update_result.reboot_required == 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1561b216-726e-47f2-956e-f862b12d3cf6%40googlegroups.com.

Karolis Pocius

unread,
May 18, 2020, 1:10:17 AM5/18/20
to ansible...@googlegroups.com
The spacing on "register: update_result" is off -- you need to move it back a bit (align it with "win_updates").

Tony Wong

unread,
May 18, 2020, 8:28:18 AM5/18/20
to ansible...@googlegroups.com

Jack Morgan

unread,
May 18, 2020, 10:23:06 AM5/18/20
to ansible...@googlegroups.com
You should know about ansible-lint as you can find these yourself.

#ansible-lint install_windows_KBxxxxx_updates.yml
signature.asc
Reply all
Reply to author
Forward
0 new messages