mirror of https://github.com/ansible/ansible.git
Allow tasks to notify a fqcn handler name (#68213)
* Allow tasks to notify a fqcn handler name * Add tests. Fixes #68181 * Add changelog fragment * Add test to ensure handlers are deduped properly with fqcn, role, and just handler names * Add some docs about new special varspull/68135/head
parent
4f8e98d322
commit
087be1da50
@ -0,0 +1,6 @@
|
|||||||
|
bugfixes:
|
||||||
|
- Allow tasks to notify a fqcn handler name (https://github.com/ansible/ansible/issues/68181)
|
||||||
|
minor_changes:
|
||||||
|
- Add new magic variable ``ansible_collection`` that contains the collection name
|
||||||
|
- Add new magic variable ``ansible_role_name`` that contains the FQCN of the role
|
||||||
|
- Updates ``ansible_role_names``, ``ansible_play_role_names``, and ``ansible_dependent_role_names`` to include the FQCN
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
# This handler should only be called 1 time, if it's called more than once
|
||||||
|
# this task should fail on subsequent executions
|
||||||
|
- name: test_fqcn_handler
|
||||||
|
set_fact:
|
||||||
|
handler_counter: '{{ handler_counter|int + 1 }}'
|
||||||
|
failed_when: handler_counter|int > 1
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- testns.testcoll.common_handlers
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
- debug:
|
||||||
|
msg: Fire fqcn handler
|
||||||
|
changed_when: true
|
||||||
|
notify:
|
||||||
|
- 'testns.testcoll.common_handlers : test_fqcn_handler'
|
||||||
|
- 'common_handlers : test_fqcn_handler'
|
||||||
|
- 'test_fqcn_handler'
|
||||||
Loading…
Reference in New Issue