mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
deprecate invalid variable names in inventory (#85377)
* deprecate invalid variable names in inventory
* was previously a hard error for `Host`
* added missing check to `Group`
* swapped blanket Python keyword prohibition with Jinja singleton and `not` check
Co-authored-by: Matt Clay <matt@mystile.com>
* fix invalid variable name test
---------
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 3c52b14c9e)
This commit is contained in:
@@ -92,7 +92,6 @@ breaking_changes:
|
||||
- templating - Access to ``_`` prefixed attributes and methods, and methods with known side effects, is no longer permitted.
|
||||
In cases where a matching mapping key is present, the associated value will be returned instead of an error.
|
||||
This increases template environment isolation and ensures more consistent behavior between the ``.`` and ``[]`` operators.
|
||||
- inventory - Invalid variable names provided by inventories result in an inventory parse failure. This behavior is now consistent with other variable name usages throughout Ansible.
|
||||
- internals - The ``ansible.utils.native_jinja`` Python module has been removed.
|
||||
- internals - The ``AnsibleLoader`` and ``AnsibleDumper`` classes for working with YAML are now factory functions and cannot be extended.
|
||||
- public API - The ``ansible.vars.fact_cache.FactCache`` wrapper has been removed.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
bugfixes:
|
||||
- variables - Added Jinja scalar singletons (``true``, ``false``, ``none``) to invalid Ansible variable name detection.
|
||||
Previously, variables with these names could be assigned without error, but could not be resolved.
|
||||
minor_changes:
|
||||
- variables - Removed restriction on usage of most Python keywords as Ansible variable names.
|
||||
deprecated_features:
|
||||
- inventory plugins - Setting invalid Ansible variable names in inventory plugins is deprecated.
|
||||
Reference in New Issue
Block a user