Integration tests for notify with variable list (#66423)

Co-authored-by: Luca Berruti <nadirio@gmail.com>

Co-authored-by: lberruti <nadirio@gmail.com>
This commit is contained in:
Sloane Hertel 2020-02-08 12:41:06 -05:00 committed by GitHub
parent 88efb24ff8
commit 3f5aed056b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 0 deletions

View file

@ -13,3 +13,9 @@
set_fact: set_fact:
role_templated_listener: True role_templated_listener: True
listen: "{{ handler4 }}" listen: "{{ handler4 }}"
- name: name5
set_fact:
role_handler5: True
- set_fact:
role_handler6: True
listen: name6

View file

@ -14,3 +14,13 @@
- role_templated_name is defined - role_templated_name is defined
- role_non_templated_listener is defined - role_non_templated_listener is defined
- role_templated_listener is undefined - role_templated_listener is undefined
- command: echo
notify: "{{ handler_list }}"
- meta: flush_handlers
- assert:
that:
- role_handler5 is defined
- role_handler6 is defined

View file

@ -6,6 +6,9 @@
handler2: name2 handler2: name2
handler3: name3 handler3: name3
handler4: name4 handler4: name4
handler_list:
- name5
- name6
handlers: handlers:
- name: name1 - name: name1
@ -22,6 +25,12 @@
set_fact: set_fact:
templated_listener: True templated_listener: True
listen: "{{ handler4 }}" listen: "{{ handler4 }}"
- name: name5
set_fact:
handler5: True
- set_fact:
handler6: True
listen: name6
tasks: tasks:
- command: echo Hello World - command: echo Hello World
@ -40,4 +49,14 @@
- non_templated_listener is defined - non_templated_listener is defined
- templated_listener is undefined - 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 - include_role: name=test_templating_in_handlers