Re: [ansible-project] playbook to restart node if uptime is greater than 100 days

2017-08-13 Thread Kai Stian Olstad
On 13. aug. 2017 12:55, Sameer Modak wrote: But what if i want to grep days from output and then write condition on it. Is it possible. Now it will not possible for most of the thing to have direct implementation. Hence can we grep >100 days from output and then restart. You could always use

Re: [ansible-project] playbook to restart node if uptime is greater than 100 days

2017-08-13 Thread Sameer Modak
Thanks kai, But what if i want to grep days from output and then write condition on it. Is it possible. Now it will not possible for most of the thing to have direct implementation. Hence can we grep >100 days from output and then restart. On Thursday, August 10, 2017 at 10:54:36 PM UTC+5:30,

Re: [ansible-project] playbook to restart node if uptime is greater than 100 days

2017-08-10 Thread Kai Stian Olstad
On 10. aug. 2017 11:25, Sameer Modak wrote: I could rit playbook to get uptime but how we can take action on the output received from ansible. how we can grep days from below output and rit restart code for the same. ok: [NESSTDDB01] => { "result.stdout": " 12:03pm up 343 days 16:57, 1 us

[ansible-project] playbook to restart node if uptime is greater than 100 days

2017-08-10 Thread Sameer Modak
I could rit playbook to get uptime but how we can take action on the output received from ansible. how we can grep days from below output and rit restart code for the same. ok: [NESSTDDB01] => { "result.stdout": " 12:03pm up 343 days 16:57, 1 user, load average: 5.15, 5.37, 5.21" If days