Skip to content

Commit 9eb3e13

Browse files
patchback[bot]ansible-documentation-bot[bot]felixfontein
authored
Add the Ansible community 12.0.0b4 porting guide (#2998) (#2999)
(cherry picked from commit c76d0de) Co-authored-by: ansible-documentation-bot[bot] <147556122+ansible-documentation-bot[bot]@users.noreply.github.com> Co-authored-by: Felix Fontein <[email protected]>
1 parent bff14c7 commit 9eb3e13

File tree

1 file changed

+102
-2
lines changed

1 file changed

+102
-2
lines changed

docs/docsite/rst/porting_guides/porting_guide_12.rst

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ Due to some string results previously parsing as lists, this mistake often went
376376

377377
The result of this template becomes a string:
378378

379-
.. code-block:: console
379+
.. code-block:: ansible-output
380380
381381
ok: [localhost] => {
382382
"msg": "['prod1', 'prod2']"
@@ -393,7 +393,7 @@ This can be resolved by using the ``map`` filter to apply the ``replace`` filter
393393

394394
The result of the corrected template remains a list:
395395

396-
.. code-block:: console
396+
.. code-block:: ansible-output
397397
398398
ok: [localhost] => {
399399
"msg": [
@@ -419,6 +419,65 @@ and intermediate nested or indirected templated results are cached for the durat
419419
reducing repetitive templating.
420420
These changes have shown exponential performance improvements for many real-world complex templating scenarios.
421421

422+
Consistent handling of range
423+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
424+
425+
The result of using the Jinja global function ``range()`` was heavily dependent on the context in which it was used and
426+
whether Jinja's native mode was enabled.
427+
To preserve the ability to use very large ranges in filter chains the result is now always a range object, which means
428+
it cannot be returned from a template unless you convert it to a returnable type.
429+
430+
Example - intentional list conversion
431+
"""""""""""""""""""""""""""""""""""""
432+
433+
.. code-block:: yaml+jinja
434+
435+
- debug:
436+
loop: "{{ range(0, 2) }}"
437+
438+
Ranges not embedded in containers would usually be converted to lists during template finalization.
439+
They will now result in this error:
440+
441+
.. code-block:: text
442+
443+
Error rendering template: Type 'range' is unsupported for variable storage.
444+
445+
446+
This can be resolved by making the conversion explicit:
447+
448+
.. code-block:: yaml+jinja
449+
450+
- debug:
451+
loop: "{{ range(0, 2) | list }}"
452+
453+
454+
Example - unintentional string conversion
455+
"""""""""""""""""""""""""""""""""""""""""
456+
457+
.. code-block:: yaml+jinja
458+
459+
- debug:
460+
msg: "{{ [range(0,2), range(7,10)] }}"
461+
462+
463+
Ranges embedded in containers would usually be converted to string representations of the range object.
464+
465+
.. code-block:: ansible-output
466+
467+
ok: [localhost] => {
468+
"msg": "[range(0, 2), range(7, 10)]"
469+
}
470+
471+
Attempting to do this will now result in an error; you can mimic the old behaviour by explicitly converting the container
472+
to a string, or convert the ranges to lists if you actually want to do something useful with them.
473+
474+
.. code-block:: yaml+jinja
475+
476+
- debug:
477+
msg: "{{ [range(0,2), range(7,10)] | string }}"
478+
479+
- debug:
480+
msg: "{{ [range(0,2), range(7,10)] | map('list') }}"
422481

423482
Error handling
424483
--------------
@@ -816,6 +875,47 @@ Networking
816875

817876
No notable changes
818877

878+
Porting Guide for v12.0.0b4
879+
===========================
880+
881+
Major Changes
882+
-------------
883+
884+
cisco.ios
885+
^^^^^^^^^
886+
887+
- Bumping `dependencies` of ansible.netcommon to `>=8.1.0`, since previous versions of the dependency had compatibility issues with `ansible-core>=2.19`.
888+
889+
cisco.iosxr
890+
^^^^^^^^^^^
891+
892+
- Bumping `dependencies` of ansible.netcommon to `>=8.1.0`, since previous versions of the dependency had compatibility issues with `ansible-core>=2.19`.
893+
894+
cisco.nxos
895+
^^^^^^^^^^
896+
897+
- Bumping `dependencies` of ansible.netcommon to `>=8.1.0`, since previous versions of the dependency had compatibility issues with `ansible-core>=2.19`.
898+
899+
dellemc.unity
900+
^^^^^^^^^^^^^
901+
902+
- Adding support for Unity v5.5.
903+
904+
Deprecated Features
905+
-------------------
906+
907+
- The ``ibm.qradar`` collection has been deprecated.
908+
It will be removed from Ansible 13 if no one starts maintaining it again before Ansible 13.
909+
See `Collections Removal Process for unmaintained collections <https://docs.ansible.com/ansible/devel/community/collection_contributors/collection_package_removal.html#unmaintained-collections>`__ for more details (`https://forum.ansible.com/t/44259 <https://forum.ansible.com/t/44259>`__).
910+
911+
community.general
912+
^^^^^^^^^^^^^^^^^
913+
914+
- bearychat - module is deprecated and will be removed in community.general 12.0.0 (https://github.com/ansible-collections/community.general/issues/10514).
915+
- cpanm - deprecate ``mode=compatibility``, ``mode=new`` should be used instead (https://github.com/ansible-collections/community.general/pull/10434).
916+
- github_repo - deprecate ``force_defaults=true`` (https://github.com/ansible-collections/community.general/pull/10435).
917+
- rocketchat - the default value for ``is_pre740``, currently ``true``, is deprecated and will change to ``false`` in community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/10490).
918+
819919
Porting Guide for v12.0.0b3
820920
===========================
821921

0 commit comments

Comments
 (0)