mirror of
https://github.com/ansible/ansible.git
synced 2026-08-01 00:34:56 +02:00
Remove redundant vars FA on PlaybookInclude (#85395)
* The redundant FA declaration was not static, which broke a number of automatic validation behaviors. * Added tests to assert deferred validation and lack of templating on `import_playbook.vars`. Co-authored-by: Matt Clay <matt@mystile.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Verify an imported playbook can see a var it was given
|
||||
assert:
|
||||
that: pb_var == 'hello'
|
||||
@@ -20,3 +20,15 @@
|
||||
|
||||
# https://github.com/ansible/ansible/issues/59548
|
||||
- import_playbook: sub_playbook/sub_playbook.yml
|
||||
|
||||
- name: Use set_fact to declare a variable
|
||||
hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- set_fact:
|
||||
a_var_from_set_fact: hello
|
||||
|
||||
- name: Verify vars for import_playbook are not templated too early
|
||||
import_playbook: playbook_using_a_var.yml
|
||||
vars:
|
||||
pb_var: "{{ a_var_from_set_fact }}"
|
||||
|
||||
Reference in New Issue
Block a user