forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for searching handler subdir for included tasks (ansible#73809)
* Allow for searching handler subdir for included tasks
- Loading branch information
Showing
7 changed files
with
83 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/integration/targets/handlers/roles/test_role_handlers_include_tasks/handlers/A.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- debug: msg="handler with tasks from A.yml called" |
5 changes: 5 additions & 0 deletions
5
test/integration/targets/handlers/roles/test_role_handlers_include_tasks/handlers/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
1 change: 1 addition & 0 deletions
1
test/integration/targets/handlers/roles/test_role_handlers_include_tasks/tasks/B.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- debug: msg="handler with tasks from B.yml called" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/integration/targets/handlers/test_role_handlers_including_tasks.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |