mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
14b8e2cf01
Fixes #8758
28 lines
815 B
YAML
28 lines
815 B
YAML
---
|
|
- hosts: testhost
|
|
vars:
|
|
- vars_var: "vars_var"
|
|
- param_var: "BAD!"
|
|
- vars_files_var: "BAD!"
|
|
vars_files:
|
|
- vars/test_var_precedence.yml
|
|
roles:
|
|
- { role: test_var_precedence, param_var: "param_var" }
|
|
tasks:
|
|
- name: register a result
|
|
command: echo 'BAD!'
|
|
register: registered_var
|
|
- name: use set_fact to override the registered_var
|
|
set_fact: registered_var="this is from set_fact"
|
|
- debug: var=extra_var
|
|
- debug: var=vars_var
|
|
- debug: var=vars_files_var
|
|
- debug: var=vars_files_var_role
|
|
- debug: var=registered_var
|
|
- assert:
|
|
that:
|
|
- 'extra_var == "extra_var"'
|
|
- 'vars_var == "vars_var"'
|
|
- 'vars_files_var == "vars_files_var"'
|
|
- 'vars_files_var_role == "vars_files_var_role3"'
|
|
- 'registered_var == "this is from set_fact"'
|