ansible-playbook exit codes bug?

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?