Skip to content

Commit b2b36f2

Browse files
Add the Ansible community 13.0.0a4 porting guide (#3174)
Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>
1 parent 3073996 commit b2b36f2

File tree

1 file changed

+181
-5
lines changed

1 file changed

+181
-5
lines changed

docs/docsite/rst/porting_guides/porting_guide_13.rst

Lines changed: 181 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,187 @@ Ansible 13 is based on Ansible-core 2.20.
1515

1616
We suggest you read this page along with the `Ansible 13 Changelog <https://github.com/ansible-community/ansible-build-data/blob/main/13/CHANGELOG-v13.md>`_ to understand what updates you may need to make.
1717

18+
.. _2.20_introduction:
19+
20+
Introduction
21+
============
22+
23+
No notable changes
24+
25+
.. _2.20_playbook:
26+
27+
Playbook
28+
========
29+
30+
Removed quote stripping in PowerShell operations
31+
-------------------------------------------------
32+
33+
The PowerShell module utilities no longer attempt to remove quotes from paths when performing Windows operations like copying and fetching files. This should not affect normal playbooks unless a value is quoted too many times. If you have playbooks that rely on this automatic quote removal, you will need to adjust your path formatting.
34+
35+
.. _2.20_engine:
36+
37+
Engine
38+
======
39+
40+
No notable changes
41+
42+
.. _2.20_plugin_api:
43+
44+
Plugin API
45+
==========
46+
47+
Removed Features
48+
----------------
49+
50+
The following previously deprecated features have been removed:
51+
52+
* The ``DEFAULT_TRANSPORT`` configuration option no longer supports the ``smart`` value that selected the default transport as either ``ssh`` or ``paramiko`` based on the underlying platform configuration.
53+
* The ``vault`` and ``unvault`` filters no longer accept the deprecated ``vaultid`` parameter.
54+
* The ``ansible-galaxy`` command no longer supports the v2 Galaxy server API. Galaxy servers hosting collections must support v3.
55+
* The ``dnf`` and ``dnf5`` modules no longer support the deprecated ``install_repoquery`` option.
56+
* The ``encrypt`` module utility no longer includes the deprecated ``passlib_or_crypt`` API.
57+
* The ``paramiko`` connection plugin no longer supports the ``PARAMIKO_HOST_KEY_AUTO_ADD`` and ``PARAMIKO_LOOK_FOR_KEYS`` configuration keys, which were previously deprecated.
58+
* The ``py3compat.environ`` call has been removed.
59+
* Vars plugins that do not inherit from ``BaseVarsPlugin`` and define a ``get_vars`` method can no longer use the deprecated ``get_host_vars`` or ``get_group_vars`` fallback.
60+
* The ``yum_repository`` module no longer supports the deprecated ``keepcache`` option.
61+
62+
Behavioral Changes
63+
------------------
64+
65+
* The ``DataLoader.get_basedir`` method now returns an absolute path instead of a relative path. Plugin code that relies on relative paths may need adjustment.
66+
* Argument spec validation now treats ``None`` values as empty strings for the ``str`` type for better consistency with pre-2.19 templating conversions.
67+
* When using ``failed_when`` to suppress an error, the ``exception`` key in the result is now renamed to ``failed_when_suppressed_exception``. This prevents the error from being displayed by callbacks after being suppressed. If you have playbooks that check for the exception in the result, update them as follows:
68+
69+
.. code-block:: yaml+jinja
70+
71+
# Before
72+
- command: /bin/false
73+
register: result
74+
failed_when: false
75+
76+
- debug:
77+
msg: "Exception was: {{ result.exception }}"
78+
when: result.exception is defined
79+
80+
# After
81+
- command: /bin/false
82+
register: result
83+
failed_when: false
84+
85+
- debug:
86+
msg: "Exception was: {{ result.failed_when_suppressed_exception }}"
87+
when: result.failed_when_suppressed_exception is defined
88+
89+
.. _2.20_command_line:
90+
91+
Command Line
92+
============
93+
94+
* Python 3.11 is no longer a supported control node version. Python 3.12+ is now required for running Ansible.
95+
* Python 3.8 is no longer a supported remote version. Python 3.9+ is now required for target execution.
96+
97+
.. _2.20_deprecated:
98+
99+
Deprecated
100+
==========
101+
102+
INJECT_FACTS_AS_VARS
103+
--------------------
104+
105+
The ``INJECT_FACTS_AS_VARS`` configuration currently defaults to ``True``, but this is now deprecated and it will switch to ``False`` in Ansible 2.24.
106+
107+
When enabled, facts are available both inside the ``ansible_facts`` dictionary and as individual variables in the main namespace. In the ``ansible_facts`` dictionary, the ``ansible_`` prefix is removed from fact names.
108+
109+
You will receive deprecation warnings if you are accessing 'injected' facts. To prepare for the future default:
110+
111+
**Update your playbooks to use the ansible_facts dictionary:**
112+
113+
.. code-block:: yaml+jinja
114+
115+
# Deprecated - will stop working in 2.24
116+
- debug:
117+
msg: "OS: {{ ansible_os_distribution }}"
118+
119+
# Recommended - works in all versions
120+
- debug:
121+
msg: "OS: {{ ansible_facts['distribution'] }}"
122+
# Note: 'ansible_' prefix is removed inside ansible_facts
123+
124+
**Or explicitly enable the current behavior in your configuration:**
125+
126+
In your ``ansible.cfg`` file:
127+
128+
.. code-block:: ini
129+
130+
[defaults]
131+
inject_facts_as_vars = True
132+
133+
By exporting an environment variable:
134+
135+
.. code-block:: shell
136+
137+
export ANSIBLE_INJECT_FACT_VARS=True
138+
139+
Other Deprecations
140+
------------------
141+
142+
* The ``vars`` 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.
143+
* Specifying ``ignore_files`` as a string in the ``include_vars`` module is deprecated. Use a list instead:
144+
145+
.. code-block:: yaml
146+
147+
# Deprecated
148+
- include_vars:
149+
dir: vars/
150+
ignore_files: ".gitkeep"
151+
152+
# Correct
153+
- include_vars:
154+
dir: vars/
155+
ignore_files: [".gitkeep"]
156+
157+
.. _2.20_modules:
158+
159+
Modules
160+
=======
161+
162+
Modules removed
163+
---------------
164+
165+
The following modules no longer exist:
166+
167+
* No notable changes
168+
169+
Deprecation notices
170+
-------------------
171+
172+
No notable changes
173+
174+
Noteworthy module changes
175+
-------------------------
176+
177+
* The ``include_vars`` module now raises an error if the ``extensions`` parameter is not specified as a list. Previously, non-list values were silently accepted.
178+
* The ``include_vars`` module now raises an error if the ``ignore_files`` parameter is not specified as a list. Previously, string values were accepted but are now deprecated.
179+
* The ``replace`` module now reads and writes files in text-mode as unicode characters instead of as bytes, and switches regex matching to unicode characters instead of bytes. This may affect playbooks that rely on byte-level operations.
180+
181+
Plugins
182+
=======
183+
184+
Noteworthy plugin changes
185+
-------------------------
186+
187+
No notable changes
188+
189+
Porting custom scripts
190+
======================
191+
192+
No notable changes
193+
194+
Networking
195+
==========
196+
197+
No notable changes
198+
18199
Porting Guide for v13.0.0a3
19200
===========================
20201

@@ -111,11 +292,6 @@ Ansible-core
111292
Deprecated Features
112293
-------------------
113294

114-
Ansible-core
115-
^^^^^^^^^^^^
116-
117-
- Deprecate the ``ansible.module_utils.six`` module. Use the Python standard library equivalent instead.
118-
119295
dellemc.powerflex
120296
^^^^^^^^^^^^^^^^^
121297

0 commit comments

Comments
 (0)