# count ignore\_errors as failed in play recap.

**URL:** <https://forum.ansible.com/t/count-ignore-errors-as-failed-in-play-recap/27471>\
**Category:** Ansible Project\
**Created:** [May 7, 2018, 11:28am UTC](https://forum.ansible.com/t/count-ignore-errors-as-failed-in-play-recap/27471 "2018-05-07T11:28:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mxj](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@mxj](https://forum.ansible.com/u/mxj)\
**Post date:** [May 7, 2018, 11:28am UTC](https://forum.ansible.com/t/count-ignore-errors-as-failed-in-play-recap/27471/1 "2018-05-07T11:28:50Z")

</div>

Hi,

can someone help me is it possible to count ignore\_errors as failed in play recap ? as below sample. it supposed to have 4 Failed.

Thanks,

Mujahiddin Janapi

PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Temp folder creation] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

changed: [ninjalab]

changed: [wildcard]

changed: [equestcj]

TASK [Copy local template config to remote temp folder] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

changed: [ninjalab] =\> (item={u’dest’: u’/tmp/devops-checks/sshd\_config.template’, u’src’: u’/home/mxj/project/sshd\_config.template’})

changed: [wildcard] =\> (item={u’dest’: u’/tmp/devops-checks/sshd\_config.template’, u’src’: u’/home/mxj/project/sshd\_config.template’})

changed: [equestcj] =\> (item={u’dest’: u’/tmp/devops-checks/sshd\_config.template’, u’src’: u’/home/mxj/project/sshd\_config.template’})

changed: [ninjalab] =\> (item={u’dest’: u’/tmp/devops-checks/passwd.template’, u’src’: u’/home/mxj/project/passwd.template’})

changed: [wildcard] =\> (item={u’dest’: u’/tmp/devops-checks/passwd.template’, u’src’: u’/home/mxj/project/passwd.template’})

changed: [equestcj] =\> (item={u’dest’: u’/tmp/devops-checks/passwd.template’, u’src’: u’/home/mxj/project/passwd.template’})

TASK [Copy remote current config to remote temp folder] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

changed: [ninjalab] =\> (item={u’dest’: u’/tmp/devops-checks/sshd\_config.current’, u’src’: u’/etc/ssh/sshd\_config’})

changed: [wildcard] =\> (item={u’dest’: u’/tmp/devops-checks/sshd\_config.current’, u’src’: u’/etc/ssh/sshd\_config’})

changed: [equestcj] =\> (item={u’dest’: u’/tmp/devops-checks/sshd\_config.current’, u’src’: u’/etc/ssh/sshd\_config’})

changed: [ninjalab] =\> (item={u’dest’: u’/tmp/devops-checks/passwd.current’, u’src’: u’/etc/passwd’})

changed: [wildcard] =\> (item={u’dest’: u’/tmp/devops-checks/passwd.current’, u’src’: u’/etc/passwd’})

changed: [equestcj] =\> (item={u’dest’: u’/tmp/devops-checks/passwd.current’, u’src’: u’/etc/passwd’})

TASK [Analyzing sshd config] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

changed: [ninjalab]

changed: [wildcard]

fatal: [equestcj]: FAILED! =\> {“changed”: true, “cmd”: “diff -w --side-by-side sshd\_config.template sshd\_config.current \> 103.197.59.221sshd.out”, “delta”: “0:00:00.008898”, “end”: “2018-05-07 19:20:27.846172”, “failed\_when\_result”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-05-07 19:20:27.837274”, “stderr”: “”, “stderr\_lines”: , “stdout”: “”, “stdout\_lines”: }

…ignoring

TASK [Analyzing passwd file] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

fatal: [ninjalab]: FAILED! =\> {“changed”: true, “cmd”: “diff -w --side-by-side passwd.template passwd.current \> 128.199.149.173passwd.out”, “delta”: “0:00:00.005960”, “end”: “2018-05-07 11:20:28.723825”, “failed\_when\_result”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-05-07 11:20:28.717865”, “stderr”: “”, “stderr\_lines”: , “stdout”: “”, “stdout\_lines”: }

…ignoring

fatal: [wildcard]: FAILED! =\> {“changed”: true, “cmd”: “diff -w --side-by-side passwd.template passwd.current \> 128.199.241.228passwd.out”, “delta”: “0:00:00.008222”, “end”: “2018-05-07 11:20:28.835798”, “failed\_when\_result”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-05-07 11:20:28.827576”, “stderr”: “”, “stderr\_lines”: , “stdout”: “”, “stdout\_lines”: }

…ignoring

fatal: [equestcj]: FAILED! =\> {“changed”: true, “cmd”: “diff -w --side-by-side passwd.template passwd.current \> 103.197.59.221passwd.out”, “delta”: “0:00:00.010196”, “end”: “2018-05-07 19:20:29.009931”, “failed\_when\_result”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-05-07 19:20:28.999735”, “stderr”: “”, “stderr\_lines”: , “stdout”: “”, “stdout\_lines”: }

…ignoring

TASK [Clean-up remote temp folder] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

changed: [ninjalab]

changed: [wildcard]

changed: [equestcj]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

equestcj : ok=6 changed=6 unreachable=0 failed=0

ninjalab : ok=6 changed=6 unreachable=0 failed=0

wildcard : ok=6 changed=6 unreachable=0 failed=0

- hosts: all

gather\_facts: no

tasks:

- name: Temp folder creation

file:

path: /tmp/devops-checks

state: directory

- name: Copy local template config to remote temp folder

copy: src={{ item.src }} dest={{ item.dest }}

with\_items:

- { src: ‘/home/mxj/project/sshd\_config.template’, dest: ‘/tmp/devops-checks/sshd\_config.template’ }

- { src: ‘/home/mxj/project/passwd.template’, dest: ‘/tmp/devops-checks/passwd.template’ }

- name: Copy remote current config to remote temp folder

copy: remote\_src=true src={{ item.src }} dest={{ item.dest }}

with\_items:

- { src: ‘/etc/ssh/sshd\_config’, dest: ‘/tmp/devops-checks/sshd\_config.current’ }

- { src: ‘/etc/passwd’, dest: ‘/tmp/devops-checks/passwd.current’ }

- name: Analyzing sshd config

shell: diff -w --side-by-side sshd\_config.template sshd\_config.current \> {{ansible\_host}}sshd.out

register: diff1\_cmd

ignore\_errors: true

failed\_when: diff1\_cmd.rc == 1

args:

chdir: /tmp/devops-checks/

- name: Analyzing passwd file

shell: diff -w --side-by-side passwd.template passwd.current \> {{ansible\_host}}passwd.out

register: diff2\_cmd

ignore\_errors: true

failed\_when: diff2\_cmd.rc == 1

args:

chdir: /tmp/devops-checks/

- name: Clean-up remote temp folder

file:

path: /tmp/devops-checks

state: absent
