Skip to content

Commit

Permalink
Merge pull request #1189 from ericzolf/ericzolf-fix-ipaddr
Browse files Browse the repository at this point in the history
The ipaddr/ipv4/ipv6 filters have moved from netcommon to utils
  • Loading branch information
oraNod authored Mar 21, 2024
2 parents 1d0b46b + 461eff6 commit d03b9b3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/docsite/rst/playbook_guide/playbooks_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ These filters help you with common network tasks.

.. note::

These filters have migrated to the `ansible.netcommon <https://galaxy.ansible.com/ansible/netcommon>`_ collection. Follow the installation instructions to install that collection.
These filters have migrated to the `ansible.utils <https://galaxy.ansible.com/ansible/utils>`_ collection. Follow the installation instructions to install that collection.

.. _ipaddr_filter:

Expand All @@ -1253,25 +1253,25 @@ To test if a string is a valid IP address:

.. code-block:: yaml+jinja

{{ myvar | ansible.netcommon.ipaddr }}
{{ myvar | ansible.utils.ipaddr }}

You can also require a specific IP protocol version:

.. code-block:: yaml+jinja

{{ myvar | ansible.netcommon.ipv4 }}
{{ myvar | ansible.netcommon.ipv6 }}
{{ myvar | ansible.utils.ipv4 }}
{{ myvar | ansible.utils.ipv6 }}

IP address filter can also be used to extract specific information from an IP
address. For example, to get the IP address itself from a CIDR, you can use:

.. code-block:: yaml+jinja

{{ '192.0.2.1/24' | ansible.netcommon.ipaddr('address') }}
{{ '192.0.2.1/24' | ansible.utils.ipaddr('address') }}
# => 192.0.2.1

More information about :ansplugin:`ansible.netcommon.ipaddr#filter` filter and complete usage guide can be found
in :ref:`playbooks_filters_ipaddr`.
More information about :ansplugin:`ansible.utils.ipaddr#filter` filter and complete usage guide can be found
in :ref:`plugins_in_ansible.utils`.

.. _network_filters:

Expand Down

0 comments on commit d03b9b3

Please sign in to comment.