mirror of https://github.com/ansible/ansible.git
parent
1e415899ad
commit
88c87a3583
@ -0,0 +1,2 @@
|
|||||||
|
minor_changes:
|
||||||
|
- add from_handlers option to include_role/import_role
|
@ -0,0 +1,41 @@
|
|||||||
|
- name: verify handlers_from on include_role
|
||||||
|
hosts: A
|
||||||
|
gather_facts: False
|
||||||
|
connection: local
|
||||||
|
tags: ['scenario1']
|
||||||
|
tasks:
|
||||||
|
- name: test include_role
|
||||||
|
include_role: name=test_handlers_meta handlers_from=alternate.yml
|
||||||
|
|
||||||
|
- name: force handler run
|
||||||
|
meta: flush_handlers
|
||||||
|
|
||||||
|
- name: verify handlers ran
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "'handler1_alt_called' in hostvars[inventory_hostname]"
|
||||||
|
- "'handler2_alt_called' in hostvars[inventory_hostname]"
|
||||||
|
tags: ['scenario1']
|
||||||
|
|
||||||
|
|
||||||
|
- name: verify handlers_from on import_role
|
||||||
|
hosts: A
|
||||||
|
gather_facts: False
|
||||||
|
connection: local
|
||||||
|
tasks:
|
||||||
|
- name: set facts to false
|
||||||
|
set_fact:
|
||||||
|
handler1_alt_called: False
|
||||||
|
handler2_alt_called: False
|
||||||
|
|
||||||
|
- import_role: name=test_handlers_meta handlers_from=alternate.yml
|
||||||
|
|
||||||
|
- name: force handler run
|
||||||
|
meta: flush_handlers
|
||||||
|
|
||||||
|
- name: verify handlers ran
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- handler1_alt_called|bool
|
||||||
|
- handler2_alt_called|bool
|
||||||
|
tags: ['scenario1']
|
@ -0,0 +1,12 @@
|
|||||||
|
- name: set_handler_fact_1
|
||||||
|
set_fact:
|
||||||
|
handler1_called: True
|
||||||
|
handler1_alt_called: True
|
||||||
|
|
||||||
|
- name: set_handler_fact_2
|
||||||
|
set_fact:
|
||||||
|
handler2_called: True
|
||||||
|
handler2_alt_called: True
|
||||||
|
|
||||||
|
- name: count_handler
|
||||||
|
shell: echo . >> {{ handler_countpath }}
|
Loading…
Reference in New Issue