diff --git a/docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst b/docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst index 9ac350ad39..6550541eaa 100644 --- a/docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst +++ b/docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst @@ -633,6 +633,31 @@ Valid options are: Multiple options can be combined by separating them with commas. +Displaying error when undefined variables in var_files +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In previous versions of ``ansible-core``, undefined variables from var_files were silently ignored and did not trigger errors. +This is now changed and an error will be displayed when undefined variables in var_files are encountered. + +.. code-block:: yaml+jinja + + - hosts: all + vars_files: + - "{{ inventory_dir }}/vars_files/foo.yml" + +.. code-block:: ansible-output + + PLAYBOOK: foo.yml ************************************************************************ + 1 plays in foo.yml + [WARNING]: skipping vars_file item due to an undefined variable + Origin: /examples/foo.yml:6:7 + + 4 + 5 vars_files: + 6 - "{{ inventory_dir }}/vars_files/foo.yml" + ^ column 7 + + .. _plugin_api: Plugin API