Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-19 Thread Danny Rehelis
Bummer, this was the best solution so far! On Fri, Jan 13, 2017 at 4:41 PM, Jinesh Choksi wrote: > Ack. I just noticed that the example below is not a good solution since it > never did run the "Performing tasks after windows updates." task in the > main.yml file. > > Sorry. Please ignore the ex

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-13 Thread Jinesh Choksi
Ack. I just noticed that the example below is not a good solution since it never did run the "Performing tasks after windows updates." task in the main.yml file. Sorry. Please ignore the example. On Friday, 13 January 2017 14:14:58 UTC, Jinesh Choksi wrote: > > - "until: is not currently suppor

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-13 Thread Jinesh Choksi
- "until: is not currently supported on includes." (https://github.com/ansible/ansible/issues/17098) - "When you call include, Ansible actually places tasks from included file into the execution queue after the current task." (http://stackoverflow.com/a/38481496) The example below is a hack b

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-13 Thread autogun
Then I cannot figure out what am I doing wrong, can you please assist? main.yml: --- - hosts: windows_servers ignore_errors: true gather_facts: false tasks: - name: inner playbook include: update-windows.yml until: 'searched_inner.found_update_count > 0' retries: 10

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-12 Thread Matt Davis
That post is really old- include looping has worked for a long time... On Thursday, January 12, 2017 at 1:28:05 AM UTC-8, Danny Rehelis wrote: > > Hi Matt, > > Dag's solution was something I really hoped to work but then I found this > post by Brian Coca - > https://groups.google.com/forum/#!top

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-12 Thread Jinesh Choksi
Hi Danny, Did you come across this post - https://groups.google.com/d/msg/ansible-project/E1ETAVoG6d0/6vC0PGCpAwAJ ? > Right now looping over includes is doable by doing a *with_ *statement. What I trying to achieve right now would look like: > >- include: run-in-loop.yml > with_sequence: sta

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-12 Thread Danny Rehelis
Hi Matt, Dag's solution was something I really hoped to work but then I found this post by Brian Coca - https://groups.google.com/forum/#!topic/ansible-project/xGGe6WADtH0 Seems like this is not possible because "Include is not a module, more like a preprocessing macro." On Thu, Jan 12, 2017 at

[ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-11 Thread Matt Davis
The solution Dag posted is what I've always done, and it works great for me. I've been advocating for block loop support (as a cleaner solution to exactly this issue) since before it shipped, but I don't have the bandwidth to implement myself right now, and around here it's kinda "put up or shut

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-11 Thread 'J Hawkesworth' via Ansible Project
Nice trick, thank you for sharing this. Jon On Monday, January 9, 2017 at 1:44:50 PM UTC, aut...@gmail.com wrote: > > I've found a working solution, it's ugly and probably will cause more > headache but it works. > > My solution looks like this: > > --- > - hosts: localhost > ignore_errors: tr

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-09 Thread autogun
I've found a working solution, it's ugly and probably will cause more headache but it works. My solution looks like this: --- - hosts: localhost ignore_errors: true # gather_facts: true tasks: - shell: ansible-playbook wu.yml register: results until: "'\"found_update_count\":

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-08 Thread Danny Rehelis
I actually tried this and it didn't work. Later, found this post https://groups.google.com/forum/#!topic/ansible-project/xGGe6WADtH0 On Sun, Jan 8, 2017 at 10:01 PM, Dag Wieers wrote: > On Wed, 4 Jan 2017, Danny Rehelis wrote: > > Anyone? :-( >> > > Never tried it myself, but wouldn't this work

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-08 Thread Dag Wieers
On Wed, 4 Jan 2017, Danny Rehelis wrote: Anyone? :-( Never tried it myself, but wouldn't this work ? - include: update-windows.yml until: retries: 10 You will have to make sure that the condition is based on facts from the tasks in your taskbook, which include win_updates and win_reboo

Re: [ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-04 Thread Danny Rehelis
Anyone? :-( On Tue, Jan 3, 2017 at 2:56 PM, 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 update

[ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-03 Thread autogun
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

[ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-03 Thread autogun
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 d

[ansible-project] Re: How to loop thru win_updates until no updates left

2017-01-02 Thread Trond Hindenes
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 asw