handlers executed repeatedly #19647
Labels
affects_2.2
This issue/PR affects Ansible v2.2
affects_2.3
This issue/PR affects Ansible v2.3
bug
This issue/PR relates to a bug.
P2
Priority 2 - Issue Blocks Release
ISSUE TYPE
COMPONENT NAME
handlers
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 14.04.1 , Centos 7.1
SUMMARY
Handlers should only be triggered once, per the documentation, but they are triggered more than once.
"These ‘notify’ actions are triggered at the end of each block of tasks in a play, and will only be triggered once even if notified by multiple different tasks. For instance, multiple resources may indicate that apache needs to be restarted because they have changed a config file, but apache will only be bounced once to avoid unnecessary restarts."
STEPS TO REPRODUCE
create a role, as follows:
run the playbook:
cd test
ansible-playbook test.yml
EXPECTED RESULTS
/tmp/test.txt would contain a single "1"
ACTUAL RESULTS
/tmp/test.txt has three "1" values in it, corresponding to the handler running three times.
The text was updated successfully, but these errors were encountered: