Skip to content

Commit

Permalink
Integration tests for notify with variable list (ansible#66423)
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Berruti <[email protected]>

Co-authored-by: lberruti <[email protected]>
  • Loading branch information
s-hertel and lberruti authored Feb 8, 2020
1 parent 88efb24 commit 3f5aed0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
set_fact:
role_templated_listener: True
listen: "{{ handler4 }}"
- name: name5
set_fact:
role_handler5: True
- set_fact:
role_handler6: True
listen: name6
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@
- role_templated_name is defined
- role_non_templated_listener is defined
- role_templated_listener is undefined

- command: echo
notify: "{{ handler_list }}"

- meta: flush_handlers

- assert:
that:
- role_handler5 is defined
- role_handler6 is defined
19 changes: 19 additions & 0 deletions test/integration/targets/handlers/test_templating_in_handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
handler2: name2
handler3: name3
handler4: name4
handler_list:
- name5
- name6

handlers:
- name: name1
Expand All @@ -22,6 +25,12 @@
set_fact:
templated_listener: True
listen: "{{ handler4 }}"
- name: name5
set_fact:
handler5: True
- set_fact:
handler6: True
listen: name6

tasks:
- command: echo Hello World
Expand All @@ -40,4 +49,14 @@
- non_templated_listener is defined
- templated_listener is undefined

- command: echo
notify: "{{ handler_list }}"

- meta: flush_handlers

- assert:
that:
- handler5 is defined
- handler6 is defined

- include_role: name=test_templating_in_handlers

0 comments on commit 3f5aed0

Please sign in to comment.