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

Flush handlers on fail/error. #4766

Closed
resmo opened this issue Nov 1, 2013 · 3 comments
Closed

Flush handlers on fail/error. #4766

resmo opened this issue Nov 1, 2013 · 3 comments
Labels
feature This issue/PR relates to a feature request.

Comments

@resmo
Copy link
Contributor

resmo commented Nov 1, 2013

Hi

As discussed on Google Groups https://groups.google.com/forum/#!topic/ansible-devel/WsWJYgxxoB0

Problem:

If ansible fails, ansible does not flush handlers.

Expected:

ansible should flush handlers even on fail.

Use case:

...
- name: config file of service named foobar
  copy src=foobar.conf dest=/etc/foobar.conf
  notify: restart foobar

- name: we make sure foobar is running
  # having a typo here...
  service: name=foobaR state=running enabled=yes
...

So you see I have a typo in 2nd task (foobaR instead of foobar). so ansible says something like "error: could not find service named foobaR".

In the copy task, file was transferred, but service foobar was never restarted.

The next time you start the play, there is no change, so the service will not restarted again. You have to "remember" it and doing it manually or use --flush-handlers to flush them all.

@mpdehaan
Copy link
Contributor

mpdehaan commented Nov 1, 2013

As discussed on the thread, we do NOT want to do this every time.

We want instead a flag for ansible to --force-handlers

Closing this and opening the other as a RFE

@mpdehaan mpdehaan closed this as completed Nov 1, 2013
@mpdehaan
Copy link
Contributor

mpdehaan commented Nov 1, 2013

Opened here: #4777

@resmo
Copy link
Contributor Author

resmo commented Nov 2, 2013

ok, misunderstood this... sorry for confusion.

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

3 participants