mirror of https://github.com/ansible/ansible.git
fix block var inheritance (#75287)
* updated tests to conform to new block inheritance Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com> Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>pull/76907/head
parent
29b5eb6ba9
commit
b1d6750e8b
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- correctly inherit vars from parent in block (https://github.com/ansible/ansible/issues/75286).
|
@ -1,7 +1,7 @@
|
||||
- debug:
|
||||
msg: '{{ test_role_input | default("(undefined)") }}'
|
||||
register: test_role_output
|
||||
register: non_coll_role_to_call_test_role_output
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- test_role_input is not defined or test_role_input == test_role_output.msg
|
||||
- 'non_coll_role_to_call_test_role_output.msg == "include another non-coll role"'
|
||||
|
@ -0,0 +1,2 @@
|
||||
shippable/posix/group4
|
||||
context/controller
|
@ -0,0 +1,16 @@
|
||||
- name: outer
|
||||
vars:
|
||||
myvar: abc
|
||||
block:
|
||||
- assert:
|
||||
that:
|
||||
- "myvar == 'abc'"
|
||||
|
||||
- name: inner block
|
||||
vars:
|
||||
myvar: 123
|
||||
block:
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- myvar|int == 123
|
Loading…
Reference in New Issue