Handling Retries

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

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.