# Handling Retries

**URL:** <https://forum.ansible.com/t/handling-retries/20121>\
**Category:** Ansible Project\
**Created:** [January 4, 2016, 8:24pm UTC](https://forum.ansible.com/t/handling-retries/20121 "2016-01-04T20:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tennis\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Tennis\_Smith](https://forum.ansible.com/u/Tennis_Smith)\
**Post date:** [January 4, 2016, 8:24pm UTC](https://forum.ansible.com/t/handling-retries/20121/1 "2016-01-04T20:24:00Z")

</div>

Like many, I’m having problems figuring out how to handle situations where one endpoint out of several fails when running a playbook.

One obvious approach is to create logic in my calling scripts (mostly bash) which will call a playbook until one of 2 things happen:

1 - No ‘\<playbook\_name\>.retry’ files are found. That is, everything is successful

_or_

2 - Some number of attempts to run the playbook retries is exceeded.

Are there better options? And, would 2.0 negate the need to do this with the changes to ssh retries?

Thanks,

-T

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 4, 2016, 8:28pm UTC](https://forum.ansible.com/t/handling-retries/20121/2 "2016-01-04T20:28:30Z")

</div>

Ansible 2.0 contains a configuration for the ssh connection plugin called:

ANSIBLE\_SSH\_RETRIES as an environment variable

or simply `retries` under `[ssh_connection]` in your ansible.cfg file.

The default is 0, which means no retries, which is effectively 1.x behavior. You can increase that number to get more retries.
