Hi Antony,
Thanks for the mail, below is the playbook code snippet
##############################
- hosts: "{{ UI }}"
gather_facts: no
user: ops
tasks:
- name: Check total CPU cores
shell: |
cpu=`sysctl hw.model hw.machine hw.ncpu|grep hw.ncpu:`
echo "$cpu"|awk -F':' '{
if ($2 >= 5)
print "\033[32mOK:\033[0m" $0;
else
print $0, echo -e "\033[31m CRITICAL\033[0m" }'
register: err_cpu
failed_when: '"CRITICAL" in err_cpu.stdout'
args:
executable: /bin/bash
ignore_errors: true
- name: Check total memory
shell: |
mem=`echo "$(sysctl -n hw.physmem)/1024/1024/1024"|bc`
echo "$mem"|awk '{
if ($NF >= 48)
print "\033[32mOK:\033[0m" $0
else
print $0, echo -e "\033[31m CRITICAL\033[0m" }'
register: err_mem
failed_when: '"CRITICAL" in err_mem.stdout'
args:
executable: /bin/bash
ignore_errors: true
#############################
On Mon, Dec 20, 2021 at 8:06 PM Antony Stone <
[email protected]> wrote:
> On Monday 20 December 2021 at 15:34:02, 'Jitender J' via Ansible Project
> wrote:
>
> > Hi Team,
> >
> > Facing a very strange issue, my failed task output getting swapped with
> > another task, in summary, we have done some modification in the callback
> > module but never saw like this before, any suggestion
>
> My suggestion is to show us your playbook which can do this.
>
> Antony.
>
> --
> What do you call a dinosaur with only one eye? A Doyouthinkesaurus.
>
> Please reply to the
> list;
> please *don't* CC
> me.
>
--
*Regards,*
*Jitender*
--
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/CAMO4JZs_XPhYKoHNqmjTYzLVWzCo%3Dr2v4o9VWYAomquz5nNXsA%40mail.gmail.com.