mirror of https://github.com/ansible/ansible.git
vars deprecation (#85673)
internal 'vars' dict cache has not been used for long time, but kept since we could not deprecate and some users had found itpull/85723/head
parent
931c923e0e
commit
534b8c225a
@ -0,0 +1,2 @@
|
|||||||
|
deprecated_features:
|
||||||
|
- vars, the internal variable cache will be removed in 2.24. This cache, once used internally exposes variables in inconsistent states, the 'vars' and 'varnames' lookups should be used instead.
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
deprecation_message: 'The internal "vars" dictionary is deprecated'
|
||||||
|
tasks:
|
||||||
|
- shell: !unsafe ansible -m debug -a "msg='{{vars}}'" localhost
|
||||||
|
register: just_vars
|
||||||
|
|
||||||
|
- shell: !unsafe ansible -m debug -a 'msg="{{vars["'"ansible_python_interpreter"'"]}}"' localhost
|
||||||
|
register: sub_vars
|
||||||
|
|
||||||
|
- name: verify we got deprecation
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- deprecation_message in just_vars.stderr
|
||||||
|
- deprecation_message in sub_vars.stderr
|
||||||
Loading…
Reference in New Issue