Come to think of it, the reason you're trying to throttle is to manage each
reboot and check individually, rt?.... actually free strategy will allow
you to do that, in a parallel queue. If I may be presumptuous, free
strategy might be the thing you're after in your case :).

*Kosala*




On Tue, May 16, 2023 at 4:29 PM Kosala Atapattu <[email protected]>
wrote:

> serial might not be the best option for your case. I'd consider using
> throttle, and consider using free strategy, so each server which
> reboots are checked immediately.
>
> I'd use the throttle on the block level.
>
> I wrote this
> <https://medium.com/@kosala.atapattu/understanding-ansible-strategy-de8f95013ff4>
> some time back, which might be relevant to what you're looking for.
>
> *Kosala*
>
>
>
>
> On Tue, May 16, 2023 at 4:44 AM shloco <[email protected]> wrote:
>
>>
>> - name : restart app
>>   hosts: webserver
>>   serial: 1
>>   tasks:
>>     - name: send email activity start
>>       mail:
>>
>>     block:
>>        - name: Task 1
>>        - name: Task 2 - reboot node
>>          reboot:
>>        - name: check node is up and running
>>          uri:
>>            url: http://SomeURL
>>            method: GET
>>            status_code: 200
>>          register: _result
>>          until: (_result.status == 200)
>>          retries: 720  #  720 * 5 seconds = 1hour (60*60/5)
>>          delay: 5  #  Every 5 seconds
>>
>>    - name: send email activity completed
>>      run_once: true
>>      mail:
>>
>>
>> - name : restart app
>>   hosts: DBserver
>>   serial: 1
>>   tasks:
>>     - name: send email activity start
>>       run_once: true
>>       mail:
>>
>>     block:
>>        - name: Task 1
>>        - name: Task 2 - reboot node
>>        - name: check node is up and running
>>          uri:
>>            url: http://SomeURL
>>            method: GET
>>            status_code: 200
>>          register: _result
>>          until: (_result.status == 200)
>>          retries: 720  #  720 * 5 seconds = 1hour (60*60/5)
>>          delay: 5  #  Every 5 seconds
>>
>>    - name: send email activity completed
>>      run_once: true
>>      mail:
>> On Monday, May 15, 2023 at 7:30:36 PM UTC+3 shloco wrote:
>>
>>> I'm looking for a way to run the tasks that inside the block by node by
>>> node but in other hand I need to send email once in the beginning and end
>>> of the activity - after all nodes were reboot
>>>
>>> in my code example email was sent for each node the tasks are exec
>>>
>>> note: I run the playbook via AWX
>>>
>>>
>>> [image: Screen Shot 2023-05-15 at 16.47.12.png]
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/f07e30cf-ca4c-4eeb-83d4-997de9d37e1cn%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/f07e30cf-ca4c-4eeb-83d4-997de9d37e1cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAP7S5HY9n9LkCOCAUvqnUnnBbrU4tsZteqcdXpUx2NEUnWTVBQ%40mail.gmail.com.

Reply via email to