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 are greater than 100 then restart node
how we can achieve this.