mirror of https://github.com/ansible/ansible.git
Allow for searching handler subdir for included tasks (#73809)
* Allow for searching handler subdir for included taskspull/73915/head
parent
3098022146
commit
1e5ccb326f
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- A handler defined within a role will now search handlers subdir for included tasks (issue https://github.com/ansible/ansible/issues/71222).
|
||||||
@ -0,0 +1 @@
|
|||||||
|
- debug: msg="handler with tasks from A.yml called"
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
- name: role-based handler from handler subdir
|
||||||
|
include_tasks: A.yml
|
||||||
|
|
||||||
|
- name: role-based handler from tasks subdir
|
||||||
|
include_tasks: B.yml
|
||||||
@ -0,0 +1 @@
|
|||||||
|
- debug: msg="handler with tasks from B.yml called"
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
- name: Verify a role handler can include other tasks from handlers and tasks subdirs
|
||||||
|
hosts: testhost
|
||||||
|
roles:
|
||||||
|
- test_role_handlers_include_tasks
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: notify a role-based handler (include tasks from handler subdir)
|
||||||
|
debug:
|
||||||
|
msg: notifying role handler
|
||||||
|
changed_when: yes
|
||||||
|
notify: role-based handler from handler subdir
|
||||||
|
|
||||||
|
- name: notify a role-based handler (include tasks from tasks subdir)
|
||||||
|
debug:
|
||||||
|
msg: notifying another role handler
|
||||||
|
changed_when: yes
|
||||||
|
notify: role-based handler from tasks subdir
|
||||||
Loading…
Reference in New Issue