On 20.03.2019 18:20, Vino B wrote:
> Hi All,
> 
>   Request you help on how to resolve the the below task error as it is
> throwing fatal error
> 
>    - name: Check whether Kernel is latest
>      shell: (/usr/bin/uname -r | {{AK}}
> 'END{if(NR!=0||$0!="4.4.155-94.50-default"){print "FAILED :Kernel Level
> "$0" is older"} else {print "OK"}}')
>      register: kernel_age
>      failed_when: "'FAILED' in kernel_age.stdout"
>      changed_when: false
>      ignore_errors: True
>      tags: kernel
> 
> *Error:*
> *fatal:* [we1t103800002]: FAILED! => {"changed": false, "cmd":
> "(/usr/bin/uname -a | /usr/bin/awk
> 'END{if(NR!=0||$3!=\"4.4.155-94.50-default\"){print \"FAILED :Kernel Level
> \"$3\" is older\"} else {print \"OK\"}}')", "delta": "0:00:00.004601",
> "end": "2019-03-20 17:09:56.528579", "failed_when_result": true, "rc": 0,
> "start": "2019-03-20 17:09:56.523978", "stderr": "", "stderr_lines": [],
> "stdout": "FAILED :Kernel Level 4.4.155-94.50-default is older",
> "stdout_lines": ["FAILED :Kernel Level 4.4.155-94.50-default is older"]}

You should provide all the output, if you did you will see that Ansible is 
working.
This is the normal output when failed_when is triggered.


-- 
Kai Stian Olstad

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/76927942-ada3-de47-76d4-55b712f1d98a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to