-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
docs example of using notify in a block: to call a handler doesn't work #33381
Comments
Trying a few variants of that example doesn't seem to work either: Also tried with an ignore_errors: on the 'command: /bin/false' but didn't seem to matter. [newswoop:F27:ansible (devel % u=)]$ ansible-playbook -i hosts block_example.yml
PLAY [example] ***********************************************************************************
TASK [debug] *************************************************************************************
ok: [localhost] => {
"msg": "I execute normally"
}
TASK [command] ***********************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/bin/false"], "delta": "0:00:00.002713", "end": "2017-11-29 10:04:51.748003", "msg": "non-zero return code", "rc": 1, "start": "2017-11-29 10:04:51.745290", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
PLAY RECAP ***************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 results:
|
pinging @jimi-c @dharmabumstead |
Files identified in the description:
If these files are inaccurate, please update the |
This is a documentation bug; since the debug task doesn't return a 'changed' result the handler isn't notified and will never run. If you use a task that actually notifies the handler it should work as expected.
|
Files identified in the description:
If these files are inaccurate, please update the |
Files identified in the description:
If these files are inaccurate, please update the |
This issue is fixed in the docs site, can someone close? |
closing, since docs seem to have been updated |
ISSUE TYPE
Bug Report
Documentation Report
COMPONENT NAME
lib/ansible/playbook/block.py
lib/ansible/plugins/strategy/init.py
lib/ansible/executor/init.py
docs/docsite/rst/playbooks_blocks.rst
ANSIBLE VERSION
CONFIGURATION
default config
OS / ENVIRONMENT
fedora27 x86_64
SUMMARY
The example code at http://docs.ansible.com/ansible/latest/playbooks_blocks.html#id3
describing 'Another example is how to run handlers after an error occurred' doesn't work.
Not sure if the docs are wrong or if it is a bug
STEPS TO REPRODUCE
EXPECTED RESULTS
The 'run me even after an error' handler would run and debug display
the message ''this handler runs even on error''
ACTUAL RESULTS
The 'run me even after an error' doesn't appear to be run.
first, with no verbosity, then with -vvv:
with -vvv:
The text was updated successfully, but these errors were encountered: