Skip to content
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

@barlik
Copy link
Contributor

@barlik 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
Copy link
Contributor Author

@barlik barlik commented Jul 22, 2018

Proposal discussion at: ansible/proposals#132

@ansibot
Copy link
Contributor

@ansibot ansibot commented Aug 1, 2018

@barlik
Copy link
Contributor Author

@barlik barlik commented Oct 17, 2018

Any update on this?

@samccann
Copy link
Contributor

@samccann samccann commented Jun 5, 2019

@dagwieers @bcoca - any update here? looks from the proposal that the idea has merit but haven't seen any action on code reviews here in the PR?

@ghost
Copy link

@ghost ghost commented Nov 19, 2019

@barlik can you resolve conflicts?

@chrisjohnson00
Copy link

@chrisjohnson00 chrisjohnson00 commented Mar 3, 2020

Bump

@barlik barlik force-pushed the barlik:task-retries branch from 7dda294 to 57548dc Mar 3, 2020
@ansibot ansibot added the core_review label Mar 3, 2020
@barlik
Copy link
Contributor Author

@barlik barlik commented Mar 3, 2020

I've rebased the code and fixed merge conflicts. It's been a very long time since I've created this PR so hopefully everything still works.

@ansibot ansibot added needs_revision and removed core_review labels Mar 3, 2020
@ansibot ansibot added the stale_ci label Mar 11, 2020
@ansibot ansibot removed the stale_ci label Mar 29, 2020
@ciaby
Copy link

@ciaby ciaby commented Apr 8, 2020

Is this PR still open? Would be very handy to have...

@caleb15
Copy link
Contributor

@caleb15 caleb15 commented Jul 15, 2020

@bcoca can you give this a review please? If you're busy is there a different person who is available to review this?
The issue behind this is in the top 10 issues when sorted by most likes so this feature would be a significant benefit to the community.

@bcoca
Copy link
Member

@bcoca bcoca commented Jul 15, 2020

@caleb15 this is not blocked on me, anyone can review, it is on my list .. but i have a long list

@caleb15
Copy link
Contributor

@caleb15 caleb15 commented Jul 15, 2020

Thanks for the fast response. @mattclay @samccann are one of you available to review? I'd be happy to donate a coffee to you/charity in return.

@samccann
Copy link
Contributor

@samccann samccann commented Jul 20, 2020

@caleb15 alas, I can't review python changes. The docs portion LGTM.
The core team meets at 3pm ET on Tuesdays and 11AM ET on Thursdays on #ansible-meeting on IRC. You could try to bring it up there and see if that gets any review/feedback.

@bcoca
Copy link
Member

@bcoca bcoca commented Jul 21, 2020

as noted in meeting, we need more tests for current behaviour before we can proceed.
ansible/community#543 (comment)

also some had issues with the current implementation, will leave up to them to add specific comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants