[ansible-project] Ansible parallel block execution

2019-01-16 Thread Tony Chia
You can try adding —fork some-large-number  to your ansible playbook command to 
force it execute in parallel 

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c33ea68b-6443-4202-b155-f7fd755487dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible parallel block execution

2019-01-16 Thread Raoul
Hi Steve,

thanks for the hint, I'll give this module a try.

Kind regards,
Raoul

On Wednesday, January 16, 2019 at 1:57:08 PM UTC+1, Steve R wrote:
>
> There is now a "reboot" module (showed up in 2.7?) that will reboot 
> the host and wait for it to come back. 
>
> --Steve 
>
> On Wed, Jan 16, 2019 at 3:26 AM Raoul > 
> wrote: 
> > 
> > Hi, 
> > 
> > I am using in an Ansible playbook blocks to execute reboots on hosts 
> when required after applying updates. I have to ensure that the hosts are 
> back online after reboot. 
> > Using 'strategy: free' so that all defined tasks aren't executed in 
> linear order and it is not waited for a task to finish, but it looks like 
> the wait_for_connection inside the block definition is blocking the whole 
> playbook until ended. 
> > 
> > My current block looks like this: 
> > 
> > - when: reboot_required.rc != 0 
> >   block: 
> >   - name: Rebooting host 
> > become: true 
> > shell: 'shutdown -r +1 "Reboot required by Server Updates"' 
> > ignore_errors: true 
> > 
> >   - name: wait for server to come back 
> > wait_for_connection: 
> >   delay: 90 
> >   timeout: 800 
> > register: reboot_result 
> > 
> >   - debug: var=reboot_result 
> > 
> > 
> > How can I execute more reboots or wait_for_connection in parallel? 
> > 
> > Thanks for any hints, 
> > Raoul 
> > 
> > 
> > 
> > -- 
> > 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/6f1ecc99-61f9-4eb0-b237-600b7f0a6fc7%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3f4405e1-bb67-4cae-a26b-edfda8bdc761%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible parallel block execution

2019-01-16 Thread S C Rigler
There is now a "reboot" module (showed up in 2.7?) that will reboot
the host and wait for it to come back.

--Steve

On Wed, Jan 16, 2019 at 3:26 AM Raoul  wrote:
>
> Hi,
>
> I am using in an Ansible playbook blocks to execute reboots on hosts when 
> required after applying updates. I have to ensure that the hosts are back 
> online after reboot.
> Using 'strategy: free' so that all defined tasks aren't executed in linear 
> order and it is not waited for a task to finish, but it looks like the 
> wait_for_connection inside the block definition is blocking the whole 
> playbook until ended.
>
> My current block looks like this:
>
> - when: reboot_required.rc != 0
>   block:
>   - name: Rebooting host
> become: true
> shell: 'shutdown -r +1 "Reboot required by Server Updates"'
> ignore_errors: true
>
>   - name: wait for server to come back
> wait_for_connection:
>   delay: 90
>   timeout: 800
> register: reboot_result
>
>   - debug: var=reboot_result
>
>
> How can I execute more reboots or wait_for_connection in parallel?
>
> Thanks for any hints,
> Raoul
>
>
>
> --
> 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-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/6f1ecc99-61f9-4eb0-b237-600b7f0a6fc7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFbiokc0fkudDiAZPGOjCMJzYOrnQB2y5E0xpcgY2ZiGDYsg1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible parallel block execution

2019-01-16 Thread Raoul
Hi,

I am using in an Ansible playbook blocks to execute reboots on hosts when 
required after applying updates. I have to ensure that the hosts are back 
online after reboot.
Using 'strategy: free' so that all defined tasks aren't executed in linear 
order and it is not waited for a task to finish, but it looks like the 
wait_for_connection inside the block definition is blocking the whole 
playbook until ended.

My current block looks like this:

- when: reboot_required.rc != 0
  block:
  - name: Rebooting host
become: true
shell: 'shutdown -r +1 "Reboot required by Server Updates"'
ignore_errors: true

  - name: wait for server to come back
wait_for_connection:
  delay: 90
  timeout: 800
register: reboot_result

  - debug: var=reboot_result


How can I execute more reboots or wait_for_connection in parallel?

Thanks for any hints,
Raoul



-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6f1ecc99-61f9-4eb0-b237-600b7f0a6fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.