Anyone? :-( On Tue, Jan 3, 2017 at 2:56 PM, <[email protected]> wrote:
> I've also read a post by Brian Coca which stated that "*blocks do not > support any type of loop*". > What other options can be used to re-run multiple tasks (one that > checks/installs updates and the other reboots the server) until no updates > available? > > On Tuesday, January 3, 2017 at 2:18:39 PM UTC+2, [email protected] wrote: >> >> Hi, >> >> Thank for the heads up but it seems like Block does not support 'until' >> >> ERROR! 'until' is not a valid attribute for a Block >> >> >> >> On Monday, January 2, 2017 at 9:28:00 PM UTC+2, Trond Hindenes wrote: >>> >>> I can't from the top of my head recall if the "block" feature supports >>> loops, but if it does I guess that's the best way to do this. >>> >>> As far as I can remember, Microsoft's own config management tool for >>> clients (SCCM) gets around this by simply doing 2 "passes" of patching. You >>> could do that aswell, with some conditionals to only kick the second pass >>> if it's needed. >>> >>> On Monday, January 2, 2017 at 4:39:48 PM UTC+1, [email protected] wrote: >>>> >>>> Hi, >>>> >>>> I'm using win_updates module to carry out windows patching and it works >>>> pretty good. >>>> Sometime, updates have dependencies and multiple playbook execution >>>> required. >>>> >>>> I was thinking, if possible, to loop the playbook until >>>> "found_update_count > 0" without the need of running ansible-playbook >>>> multiple time after each finish. >>>> >>>> My playbook looks like this: >>>> >>>> - hosts: win_server_1 >>>> ignore_errors: true >>>> gather_facts: true >>>> >>>> tasks: >>>> - name: search wu >>>> win_updates: >>>> category_names: >>>> - UpdateRollups >>>> - CriticalUpdates >>>> - SecurityUpdates >>>> state: >>>> - searched >>>> log_path: >>>> - c:/temp/ansible_wu.txt >>>> register: searched >>>> >>>> - name: install wu >>>> win_updates: >>>> category_names: >>>> - UpdateRollups >>>> - CriticalUpdates >>>> - SecurityUpdates >>>> state: >>>> - installed >>>> log_path: >>>> - c:/temp/ansible_wu.txt >>>> register: installed >>>> when: searched.found_update_count > 0 >>>> >>>> - name: reboot >>>> win_reboot: >>>> pre_reboot_delay_sec: 0 >>>> test_command: whoami >>>> reboot_timeout_sec: 300 >>>> when: installed.reboot_required = 'true' >>>> register: reboot >>>> >>>> >>>> I cant figure out how to put this in playbook by myself, seeking for >>>> some guidance. >>>> >>>> Thanks, >>>> >>>> -- > 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 post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/ansible-project/792346e5-85b6-4b00-a345-9edd1bb2934a%40googlegroups. > com > <https://groups.google.com/d/msgid/ansible-project/792346e5-85b6-4b00-a345-9edd1bb2934a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Danny Rehelis - autogun [AT] gmail.com -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BYXgScCBoyZO6SbhY1208FPw%3D2bG7b__kpogNwMcsdz-3U6LA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
