New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use task retries without until block #43128

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@barlik
Contributor

barlik commented Jul 22, 2018

SUMMARY

This change will make task retries work without having an until block. This is useful in situations when you are not interested in the output value and/or you simply want to retry on a failure. This allows you to omit register and until parameters and makes the task easier to read.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

core engine

ANSIBLE VERSION
ansible 2.7.0.dev0 (task-retries 7dda294680) last updated 2018/07/22 11:26:54 (GMT +100)
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/kerny/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/kerny/dev/github/ansible/lib/ansible
  executable location = /home/kerny/dev/github/ansible/bin/ansible
  python version = 3.6.6 (default, Jun 27 2018, 13:11:40) [GCC 8.1.1 20180531]
ADDITIONAL INFORMATION

The change will allow you to simplify:

    - name: Retry URL call up to five times until we get 200 status code
      uri:
         url: https://httpbin.org/status/200
      register: out
      until: out is successful
      retries: 5

into:

    - name: Retry URL call up to five times until we get 200 status code
      uri:
         url: https://httpbin.org/status/200
      retries: 5

This PR also fixes a small bug (inconsistency) whereby having retries: without a value defaults to 2 retries instead of 3.

@barlik

This comment has been minimized.

Contributor

barlik commented Jul 22, 2018

Proposal discussion at: ansible/proposals#132

@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 1, 2018

@barlik

This comment has been minimized.

Contributor

barlik commented Oct 17, 2018

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment