add wildcard mask/hostmask to ipaddr filter doc page (#324)
* add wildcard mask/hostmask to ipaddr filter doc page This might seem like an unnecessary addition but wildcard filter not being here has cost me couple of hours and a failed exam. I tried to follow convention as much as I could * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add changelog and add a note in readme * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add a note in readme check * update readme * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * correct the link * correct the link * correct the link * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update changelogs/fragments/324.yaml Co-authored-by: Sagar Paul <sagpaul@redhat.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sagar Paul <sagpaul@redhat.com> Co-authored-by: Ruchi Pakhle <72685035+Ruchip16@users.noreply.github.com> Co-authored-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com> Co-authored-by: Ruchi Pakhle <ruchipakhle@gmail.com>pull/362/head
parent
3aeb82204f
commit
6425ea2299
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
doc_changes:
|
||||
- Add a wildcard mask/hostmask documentation to ipaddr filter doc page to obtain an IP address's wildcard mask/hostmask.
|
|
@ -19,6 +19,7 @@ Synopsis
|
|||
--------
|
||||
- This filter is designed to return the input value if a query is True, and False if a query is False
|
||||
- This way it can be easily used in chained filters
|
||||
- For more details on how to use this plugin, please refer to `<docsite/rst/filters_ipaddr.rst>`_
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -340,6 +340,15 @@ If needed, you can extract subnet and prefix information from the 'host/prefix'
|
|||
# {{ host_prefix | ansible.utils.ipaddr('host/prefix') | ansible.utils.ipaddr('prefix') }}
|
||||
[64, 24]
|
||||
|
||||
To get the wildcard mask from host_prefix
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
wildcard {{ host_prefix | ansible.utils.ipaddr('hostmask')}}
|
||||
|
||||
# from host_prefix '192.0.2.0/24' following will be generated
|
||||
wildcard 0.0.0.255
|
||||
|
||||
Converting subnet masks to CIDR notation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ DOCUMENTATION = """
|
|||
description:
|
||||
- This filter is designed to return the input value if a query is True, and False if a query is False
|
||||
- This way it can be easily used in chained filters
|
||||
- For more details on how to use this plugin, please refer to `<docsite/rst/filters_ipaddr.rst>`_
|
||||
options:
|
||||
value:
|
||||
description:
|
||||
|
|
Loading…
Reference in New Issue