# ansible-playbook exit codes bug?

**URL:** <https://forum.ansible.com/t/ansible-playbook-exit-codes-bug/23548>\
**Category:** Ansible Project\
**Created:** [January 24, 2017, 3:16pm UTC](https://forum.ansible.com/t/ansible-playbook-exit-codes-bug/23548 "2017-01-24T15:16:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mpampis\_Mpigkonias](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Mpampis\_Mpigkonias](https://forum.ansible.com/u/Mpampis_Mpigkonias)\
**Post date:** [January 24, 2017, 3:16pm UTC](https://forum.ansible.com/t/ansible-playbook-exit-codes-bug/23548/1 "2017-01-24T15:16:10Z")

</div>

Hello,

I have a question regarding the ansible exit codes.

I run a playbook and I have the following “PLAY RECAP”

`

> 10:52:35 |   
> |   
> | PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* |
> 
> - | - | - | - |  
> 10:52:35 |   
> |   
> | lnxcls1 : ok=0 changed=0 unreachable=0 failed=1 |  
> 10:52:35 |   
> |   
> | lnxdmt01 : ok=6 changed=2 unreachable=0 failed=0 |  
> 10:52:35 |   
> |   
> | lnxsolma : ok=6 changed=3 unreachable=0 failed=0 |

`

That gives me an exit status 2. I find this normal.

But when I run another playbook with the following recap

`

> 10:38:46 |   
> |   
> | PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* |
> 
> - | - | - | - |  
> 10:38:46 |   
> |   
> | cellctc1 : ok=6 changed=2 unreachable=0 failed=0 |  
> 10:38:46 |   
> |   
> | cellctc2 : ok=5 changed=1 unreachable=0 failed=1 |  
> 10:38:46 |   
> |   
> | lnxbootnc : ok=5 changed=1 unreachable=0 failed=1 |

`

I get an exit status 0 (!)

Why in the second case it didn’t return an exist status 2? Is this inconsistency a bug?
