Commit Graph

69 Commits (6c1c3a4b81816d4e2b1095af8235c693c2beda9a)

Author SHA1 Message Date
Giorgi Zeikidze 6425ea2299
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>
2024-07-19 20:13:24 +05:30
Ashwini Mhatre 92903a3a58
Enhance fact_diff to show common lines (#323)
* Enhance fact_diff to show common lines

* Add integration and unit tests

* Fix sanity

---------

Co-authored-by: Ashwini Mhatre <amhatre@amhatre-thinkpadt14sgen2i.pnq.csb>
2024-01-16 17:55:39 +05:30
Akira Yokochi 259cb8b9e4
docs: Fixed validate lookup plugin and module filter examples in document (#325)
* fix validate examples

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-16 14:44:01 +05:30
Akira Yokochi 6842746a9d
docs: Fixed ipv6form filter document (#320)
* fix ipv6form doc

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add changelog fragment

* rename

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ashwini Mhatre <mashu97@gmail.com>
2024-01-04 14:57:55 +05:30
Ashwini Mhatre 4f07a4afca
fact_diff filter plugin (#310)
* Add fact_diff filter plugin

* Add integration and unit tests

* Add changelog

* Add argspect test

* Add examples

* Fix lint

* Fix ansible-lint

* REvert changes

* Fix sanity

* Address review comments

* Delete tests/integration/inventory

---------

Co-authored-by: Ashwini Mhatre <amhatre@amhatre-thinkpadt14sgen2i.pnq.csb>
2023-11-13 11:28:43 +05:30
Ashwini Mhatre 4deddf2c3b
Feature ipv6 format (#295)
* Create ipv6form.py

* Update ipv6form.py

* Update ipv6form.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add code

* Add docs

* Add uts and integration tests. fix sanity

* iFix sanity

* Fix sanity

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ashwini Mhatre <amhatre@amhatre-thinkpadt14sgen2i.pnq.csb>
2023-08-10 13:40:17 +05:30
Ashwini Mhatre ce5e10c004
Add ipcut filter plugin (#291)
* Add ipcut filter plugin

* Add testcases

* Add testcases

* Fix sanity

* Fix sanity

* Fix sanity

* Fix ansible-lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update ipcut.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix sanity

* Fix sanity

* iFix sanity

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ashwini Mhatre <amhatre@amhatre-thinkpadt14sgen2i.pnq.csb>
2023-08-07 16:19:33 +05:30
Ashwini Mhatre fca1229097
Added support to disable xml declartion with full_document flag (#237) 2022-12-28 19:47:34 +05:30
Kate Case 24e53efe5e
Add documentation for IPv6 in ipsubnet filter (#212)
* fix typo. Add example for IPV6

* add unit tests for IPv6

Co-authored-by: serosset <serosset@cisco.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-05 16:00:19 -05:00
Federico Chiacchiaretta 0aee02eb97
Welcome to support for indentation with spaces in to_xml plugin (#192)
* Welcome to support for indentation with spaces in to_xml plugin

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changelog fragment

* Unit tests for:

* Indent with spaces and explicit indent_width (4)
* Invalid indent

I also slightly modified VALID_DATA to produce output with indentation,
so existing test_valid_data and OUTPUT has been updated accordingly.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix changelog section name to minor_changes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-04 14:13:13 -04:00
Felix Fontein b73ed61a47
Fix filter and test docs (#215)
* Fix filter and test documentation syntax errors.

Most cases were strings that were YAML-parsable as dictionaries due to colons,
sometimes of the form `str: str`, and sometimes of the form `str: list`.

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-14 13:02:22 -04:00
Tim Way 57c5cd4336
Switch To Calculating Networking Information Directly For Performance (#146)
* Add Unit Tests To Capture Failures From 'subnet' Generator

The netaddr library returns a generator for the 'subnet' call. This works great until you use larger networks. While it is uncommon to encounter it in IPv4 usage it is trivial to hit it in IPv6.

* Switch To Calculating Networking Information Directly For Performance

This replaces the inefficient generator for 'subnet' and uses math to determine the result directly. Since a list is not returned directly to the client in the implemented cases this works great and is fast.

A further optimization at least on the logic of this might be to break the different cases implemented by the filter out into unique functions. I did not do this yet because I wanted to get feedback on this direction.

* Changelog Fragment For PR / Bugfix

Adding changelog fragment that references source issue.

* Dropping Python 3.7 Bypass Removes Need For 'sys' Module

A test for ipsubnet was bypassed under 3.7 because of an inconsistent return value w/3.6 and 2.7. I removed the bypass and changed the behavior of the filter to raise an AnsibleFilterError in all versions of Python.

* Add A Pair of Integration Tests

These demonstrate the issue with the current implementation and would normally stall out while building the list of possible subnets from the generator.

* Address Changelog Feedback

I kept the performance item as a bugfix but bumped the typing to a minor change.

* Add 'netaddr' To Integration Test 'requirements.txt'

* The `ansible-test integration --docker` requires this line in requirements.txt to pass the 'netaddr' related tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Replace str -> to_text

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kate Case <this.is@katherineca.se>
2022-08-31 12:09:35 -04:00
Bradley A. Thornton 79a12c3c43
Enable update docs via pre-commit (#186)
* Enable update docs

* Remove foo

* Changelog

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-25 15:53:41 -07:00
Nathaniel Case e76854d1e1 Move check_mode setting to the proper location regardless of version 2022-04-25 11:11:15 -04:00
KB-perByte 6110081f19
sanity fix 2022-04-11 17:20:49 +05:30
KB-perByte ca31a4e474
update docs 2022-04-11 16:13:46 +05:30
KB-perByte 595c9ee38f
review pt 1 2022-04-08 23:31:45 +05:30
KB-perByte 89efc29ab4
update added version 2022-04-06 19:25:56 +05:30
KB-perByte f3e851d544
update review 1 2022-04-06 19:19:48 +05:30
KB-perByte 3f98e8ae7a
sanity and tox fixed 2022-04-05 15:44:37 +05:30
KB-perByte 38986edc8e
doc fix 2022-04-04 21:09:45 +05:30
KB-perByte f337f82d59
docs and examples 2022-04-04 20:02:43 +05:30
Ashwini Mhatre 0716010fe3
Fix bugs in Ipaddr filters (#149)
Fix bugs in Ipaddr filters

SUMMARY

ipaddr - Fix input validation issues in ipaddr,ipv4,ipv6,ipwrap filters.
ipaddr - Add valid network for link-local
fixes: #148
fixes: ansible-collections/ansible.netcommon#375
fixes: ansible-collections/ansible.netcommon#350

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: Sagar Paul <sagpaul@redhat.com>
2022-03-04 11:43:59 +00:00
Sandra McCann 8031770a87
move ipaddr filter docs into collection (#144)
move ipaddr filter docs into collection

SUMMARY

ipaddr moved to ansible.utils. Now moving the matching documentation over. This will be republished to docs.ansible.com on the ansible.utils page.

Fixes #130
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

docs/docsite/rst/filters_ipaddr.rst
docs/docsite/extra-docs.yml
ADDITIONAL INFORMATION

Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
2022-02-24 15:51:40 +00:00
Sagar Paul bd95db581e
minor doc fix (#140)
minor doc fix

SUMMARY

in_any_network, doc fix for redundant line

ISSUE TYPE


Docs Pull Request

COMPONENT NAME

in_any_network
ADDITIONAL INFORMATION

Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
2022-02-10 17:35:19 +00:00
Sagar Paul 9294a2df8f
doc fixes (#134)
Minor documentation fixes

SUMMARY

Minor documentation fixes and updated doc-string

ISSUE TYPE


Docs Pull Request

Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Reviewed-by: None <None>
2022-01-31 10:30:34 +00:00
Nathaniel Case ad9d3e1399
New validate sub-plugin "config" (#112)
New validate sub-plugin "config"

SUMMARY


Implement ansible-collections/ansible.network#15 as a validate sub-plugin.
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

validate

Reviewed-by: Ganesh Nalawade <None>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: None <None>
2022-01-28 00:02:36 +00:00
Sagar Paul 624bc76e26
Recursive filter plugins remove_keys | replace_keys | keep_keys (#110)
Recursive filter plugins remove_keys | replace_keys | keep_keys

SUMMARY

New plugins

remove_keys
replace_keys
keep_keys


ISSUE TYPE


New Module Pull Request

COMPONENT NAME


remove_keys
replace_keys
keep_keys

ADDITIONAL INFORMATION

Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
2022-01-27 06:52:38 +00:00
Ashwini Mhatre ea54e97359
Add hwaddr, macaddr, slaac filter plugin (#129)
Add hwaddr, macaddr, slaac filter plugin

SUMMARY

Added hwaddr, macaddr, slaac filter plugin

ISSUE TYPE

New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Reviewed-by: Sagar Paul <sagpaul@redhat.com>
Reviewed-by: None <None>
2022-01-24 21:43:18 +00:00
Ashwini Mhatre 4488b79b04
Add ipaddr Filter plugin (#115)
Add ipaddr Filter plugin

SUMMARY

depend-on: #113

ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Reviewed-by: Sagar Paul <sagpaul@redhat.com>
Reviewed-by: None <None>
2022-01-24 11:15:16 +00:00
Ashwini Mhatre cfc7965400
Add ipwrap filter plugin (#118)
Add ipwrap filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Priyam Sahoo <None>
Reviewed-by: Sagar Paul <sagpaul@redhat.com>
Reviewed-by: None <None>
2022-01-22 11:27:27 +00:00
Ashwini Mhatre 2aa677777e
Add network_in_usable filter plugin (#126)
Add network_in_usable filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
Reviewed-by: Priyam Sahoo <None>
2022-01-21 20:12:17 +00:00
Ashwini Mhatre 3cb7ea10ca
Add previous_nth_usable filter plugin (#124)
Add previous_nth_usable filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
2022-01-21 18:04:36 +00:00
Ashwini Mhatre 315200166f
Add plugin Reduce_on_network (#127)
Add plugin Reduce_on_network

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
2022-01-21 10:34:01 +00:00
Ashwini Mhatre 234b0a51cf
Add network_in_network filter plugin (#125)
Add network_in_network filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
2022-01-20 19:31:40 +00:00
Ashwini Mhatre 1d697455b6
Add next nth usable filter plugin (#123)
Add next nth usable filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Rohit Thakur <rohitthakur2590@outlook.com>
Reviewed-by: None <None>
Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
2022-01-20 17:30:14 +00:00
Ashwini Mhatre 80b7015fe8
Add ipsubnet filter plugin (#122)
Add ipsubnet filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: None <None>
2022-01-20 15:03:54 +00:00
Ashwini Mhatre c04c648b7a
Add IPV6 filter plugin (#121)
Add IPV6 filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: None <None>
2022-01-20 13:10:31 +00:00
Ashwini Mhatre 79b28faaaa
Add ipv4_hex filter plugin (#119)
Add ipv4_hex filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Priyam Sahoo <None>
Reviewed-by: None <None>
2022-01-20 11:48:12 +00:00
Ashwini Mhatre 458547c2b6
Add Ipmath filter plugin (#117)
Add Ipmath filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Sagar Paul <sagpaul@redhat.com>
Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Reviewed-by: None <None>
2022-01-20 09:49:15 +00:00
Ashwini Mhatre 22234f2963
Add cidr_merge filter plugin (#113)
Add cidr_merge filter plugin

SUMMARY

Move ipaddr plugins from netcommon to utils:
cidr_merge filter plugin

ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
2022-01-20 08:02:49 +00:00
Ashwini Mhatre 7a7ad7e811
Add Nthhost filter plugin (#128)
Add Nthhost filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
2022-01-19 19:10:50 +00:00
Ashwini Mhatre 02f2c62386
Add ipv4 plugin (#120)
Add IPV4 filter plugin

SUMMARY


ISSUE TYPE


New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: Priyam Sahoo <None>
Reviewed-by: None <None>
2022-01-17 11:41:11 +00:00
Rohit Thakur d206bf3d72
param_list_compare filter plugins docs updated (#91)
param_list_compare filter plugins docs updated

Signed-off-by: Rohit Thakur rohitthakur2590@outlook.com
SUMMARY


ISSUE TYPE


Docs Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Nathaniel Case <this.is@nathanielca.se>
Reviewed-by: None <None>
Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
2021-08-27 15:27:02 +00:00
Priyam Sahoo e0551c0127
Fix documentation issues (#80)
Fixed documentation issues

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-21 23:48:07 +00:00
Priyam Sahoo 1b76548d9d
Added 'usable_range' filter plugin (#77)
Added 'usable_range' filter plugin

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-03 07:17:07 +00:00
Priyam Sahoo 2636312822
Added 'resolvable' test plugin (#74)
Added 'resolvable' test plugin

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-14 20:24:11 +00:00
Priyam Sahoo 86923a5f2d
Added 'subnet_of', 'supernet_of', 'unspecified' IP test plugins (#73)
Added 'subnet_of', 'supernet_of', 'unspecified' IP test plugins

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-14 14:01:41 +00:00
Priyam Sahoo e57f25a510
Added 'private', 'public', 'reserved' test plugins (#72)
Added 'private', 'public', 'reserved' test plugins

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-12 15:42:19 +00:00
Priyam Sahoo 0c315db82e
Added 'loopback', 'mac', and 'multicast' test plugins (#71)
Added 'loopback', 'mac', and 'multicast' test plugins

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-11 16:23:05 +00:00