Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread Dick Visser
Hi I just confirmed that this super simple task does exactly what you need: - name: reboot and wait a bit reboot: post_reboot_delay: 120 become: true No need to fiddle with additional tasks and conditions. On Mon, 3 Apr 2023 at 17:07, vinayak sawant wrote: > > i checke

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread vinayak sawant
i checked both ways with string and without string as well it did not work. *Kind Regards* *Vinayak Sawant* On Mon, Apr 3, 2023 at 8:18 PM Antony Stone < antony.st...@ansible.open.source.it> wrote: > On Monday 03 April 2023 at 16:28:31, vinayak sawant wrote: > > > @Antony Stone : "ansible_upt

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread Antony Stone
On Monday 03 April 2023 at 16:28:31, vinayak sawant wrote: > @Antony Stone : "ansible_uptime_seconds >= '120'" is not working as shown > below. I did not mean you to add the " characters - those were simply to identify the string I think you should use in order to confirm to ansible syntax. An

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread Deepanjan Acharya
I guess you need to use gather_facts: true to be able to use the up time function here. Thanks On Mon, 3 Apr 2023 at 6:52 PM, vinayak sawant wrote: > Hello Visser > > Below is my playbook > > > [image: image.png] > > anisble_uptime_seconds does not work for me. > > > *Kind Regards* > *Vinayak S

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread Antony Stone
On Monday 03 April 2023 at 15:21:34, vinayak sawant wrote: > anisble_uptime_seconds does not work for me. " == or => '120'" ??? Try simply "ansible_uptime_seconds >= '120'" Antony. -- Too many people spend money they haven't earned to buy things they don't want, to impress people they don't

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread vinayak sawant
Hello Visser Below is my playbook [image: image.png] anisble_uptime_seconds does not work for me. *Kind Regards* *Vinayak Sawant* On Mon, Apr 3, 2023 at 2:30 PM Dick Visser wrote: > You have not shared any playbooks. > How are you doing this "rolling restart"? > > If you use the reboot mo

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread Dick Visser
You have not shared any playbooks. How are you doing this "rolling restart"? If you use the reboot module (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/reboot_module.html), then that supports the "post_reboot_delay" parameter (as mentioned in a previous answer). That will do

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-03 Thread vinayak sawant
Thanks Deepanjan. But here is how I can be sure my server is up or not. If my server is not up then it will not work right i had tried seconds from setup module but it did not work So is there any other option to perform this task as i have to reboot server one by one not all at time. Serial m

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-04-02 Thread Deepanjan Acharya
You could use a sleep task between this two tasks and assign 120sec sleep time. Example: using builtin wait module - name: Sleep for 300 seconds and continue with play ansible.builtin.wait_for:timeout: 300 delegate_to: localhost Other wise you can use shell module and use command “sleep 30

Re: [ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-03-30 Thread Rick Fee
should be close to this...but this is for windows...think if you put post_reboot_delay? - name: DAG Node - Rebooting server Exchange has been updated, wait for MSExchangeADTopology service to come back to running until rebooting the next server. win_reboot: reboot_timeout: 3600 post_rebo

[ansible-project] How to wait for uptime of 2 minutes and then execute next task

2023-03-30 Thread vinayak sawant
Hello Team i am doing rolling restart for servers and it is working fine but what i need to add is when first server is rebooted and its up for 2 minutes then it should go for next server for reboot So how can I take that uptime condition with shell in ansible playbook to proceed. *Kind Regards