1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-07-06 02:28:53 +00:00

Template run_once for handlers (#54030)

Fixes #27237
This commit is contained in:
Martin Krizek 2019-03-20 14:46:19 +01:00 committed by GitHub
parent d1a688b1d7
commit 0e28ab4528
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 7 deletions

View file

@ -75,3 +75,10 @@ set -e
# https://github.com/ansible/ansible/issues/47287
[ "$(ansible-playbook test_handlers_including_task.yml -i ../../inventory -v "$@" | egrep -o 'failed=[0-9]+')" = "failed=0" ]
# https://github.com/ansible/ansible/issues/27237
set +e
result="$(ansible-playbook test_handlers_template_run_once.yml -i inventory.handlers "$@" 2>&1)"
set -e
grep -q "handler A" <<< "$result"
grep -q "handler B" <<< "$result"

View file

@ -0,0 +1,12 @@
- hosts: A,B
gather_facts: no
tasks:
- debug:
changed_when: true
notify:
- handler
handlers:
- name: handler
debug:
msg: "handler {{ inventory_hostname }}"
run_once: "{{ testvar | default(False) }}"