summaryrefslogtreecommitdiff
path: root/test/integration/targets/handlers
diff options
context:
space:
mode:
authorSloane Hertel <shertel@redhat.com>2020-02-08 12:41:06 -0500
committerGitHub <noreply@github.com>2020-02-08 12:41:06 -0500
commit3f5aed056ba349e60de6143c537cbe49f5e44312 (patch)
treef2f5bef6c5e851810eeca049e26c5943b8dcb37b /test/integration/targets/handlers
parent88efb24ff814d874ee19ba9b72d2079ec10a277d (diff)
downloadansible-3f5aed056ba349e60de6143c537cbe49f5e44312.tar.gz
Integration tests for notify with variable list (#66423)
Co-authored-by: Luca Berruti <nadirio@gmail.com> Co-authored-by: lberruti <nadirio@gmail.com>
Diffstat (limited to 'test/integration/targets/handlers')
-rw-r--r--test/integration/targets/handlers/roles/test_templating_in_handlers/handlers/main.yml6
-rw-r--r--test/integration/targets/handlers/roles/test_templating_in_handlers/tasks/main.yml10
-rw-r--r--test/integration/targets/handlers/test_templating_in_handlers.yml19
3 files changed, 35 insertions, 0 deletions
diff --git a/test/integration/targets/handlers/roles/test_templating_in_handlers/handlers/main.yml b/test/integration/targets/handlers/roles/test_templating_in_handlers/handlers/main.yml
index cc5b3a3d94..7dbf334748 100644
--- a/test/integration/targets/handlers/roles/test_templating_in_handlers/handlers/main.yml
+++ b/test/integration/targets/handlers/roles/test_templating_in_handlers/handlers/main.yml
@@ -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
diff --git a/test/integration/targets/handlers/roles/test_templating_in_handlers/tasks/main.yml b/test/integration/targets/handlers/roles/test_templating_in_handlers/tasks/main.yml
index 47dbee3c73..541741729f 100644
--- a/test/integration/targets/handlers/roles/test_templating_in_handlers/tasks/main.yml
+++ b/test/integration/targets/handlers/roles/test_templating_in_handlers/tasks/main.yml
@@ -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
diff --git a/test/integration/targets/handlers/test_templating_in_handlers.yml b/test/integration/targets/handlers/test_templating_in_handlers.yml
index b6aa71dfe6..662b8c1efb 100644
--- a/test/integration/targets/handlers/test_templating_in_handlers.yml
+++ b/test/integration/targets/handlers/test_templating_in_handlers.yml
@@ -6,6 +6,9 @@
handler2: name2
handler3: name3
handler4: name4
+ handler_list:
+ - name5
+ - name6
handlers:
- name: name1
@@ -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
@@ -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