diff options
author | Rohit Thakur <rohitthakur2590@outlook.com> | 2020-05-11 13:48:29 +0530 |
---|---|---|
committer | Rohit Thakur <rohitthakur2590@outlook.com> | 2020-05-11 13:48:29 +0530 |
commit | 44a2e8c885b1d050f9a36fc095403c1568cc1cfd (patch) | |
tree | a798b78bcc39d3c94d5fe50afdd526e414a2cfe3 | |
parent | e584c5ce7db0adbdcced3427411bbd82c6dc1b68 (diff) | |
download | vyos-ansible-collection-44a2e8c885b1d050f9a36fc095403c1568cc1cfd.tar.gz vyos-ansible-collection-44a2e8c885b1d050f9a36fc095403c1568cc1cfd.zip |
comments incorporated
Signed-off-by: Rohit Thakur <rohitthakur2590@outlook.com>
6 files changed, 105 insertions, 108 deletions
diff --git a/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py b/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py index de972bc..acda380 100644 --- a/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py +++ b/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py @@ -29,7 +29,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.facts.facts from ansible.module_utils.six import iteritems from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.utils.utils import ( - list_diff_want_only, _in_target, _is_w_same, _bool_to_str, diff --git a/plugins/module_utils/network/vyos/utils/utils.py b/plugins/module_utils/network/vyos/utils/utils.py index f2986aa..96feddd 100644 --- a/plugins/module_utils/network/vyos/utils/utils.py +++ b/plugins/module_utils/network/vyos/utils/utils.py @@ -7,7 +7,6 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -import q from ansible.module_utils.six import iteritems from ansible_collections.ansible.netcommon.plugins.module_utils.compat import ( ipaddress, diff --git a/plugins/modules/vyos_ospfv3.py b/plugins/modules/vyos_ospfv3.py index ae93500..e2d3ff7 100644 --- a/plugins/modules/vyos_ospfv3.py +++ b/plugins/modules/vyos_ospfv3.py @@ -80,11 +80,11 @@ options: parameters: descriptions: OSPFv3 specific parameters. type: dict - suboptions: - router_id: + suboptions: + router_id: description: Override the default router identifier. type: str - redistribute: + redistribute: description: Redistribute information from another routing protocol. type: list elements: dict @@ -92,10 +92,10 @@ options: route_type: description: Route type to redistribute. type: str - choices: ['bgp', 'connected', 'kernel', 'ripng', 'static'] + choices: ['bgp', 'connected', 'kernel', 'ripng', 'static'] route_map: description: Route map references. - type: str + type: str running_config: description: - This option is used only with state I(parsed). @@ -128,25 +128,24 @@ EXAMPLES = """ # # - name: Merge the provided configuration with the exisiting running configuration - vyos.vyos.vyos_ospfv3: - config: - redistribute: - - route_type: 'bgp' - parameters: - router_id: '192.0.2.10' - areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' - - range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' - range: - - address: '2001:db40::/32' - state: merged + vyos.vyos.vyos_ospfv3: + config: + redistribute: + - route_type: 'bgp' + parameters: + router_id: '192.0.2.10' + areas: + - area_id: '2' + export_list: 'export1' + import_list: 'import1' + range: + - address: '2001:db10::/32' + - address: '2001:db20::/32' + - address: '2001:db30::/32' + - area_id: '3' + range: + - address: '2001:db40::/32' + state: merged # # # ------------------------- @@ -235,25 +234,24 @@ EXAMPLES = """ # set protocols ospfv3 redistribute 'bgp' # - name: Replace ospfv3 routes attributes configuration. - vyos.vyos.vyos_ospfv3: - config: - redistribute: - - route_type: 'bgp' - parameters: - router_id: '192.0.2.10' - areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' - - range: - - address: '2001:db10::/32' - - address: '2001:db30::/32' - - address: '2001:db50::/32' - - area_id: '4' - range: - - address: '2001:db60::/32' - state: replaced + vyos.vyos.vyos_ospfv3: + config: + redistribute: + - route_type: 'bgp' + parameters: + router_id: '192.0.2.10' + areas: + - area_id: '2' + export_list: 'export1' + import_list: 'import1' + range: + - address: '2001:db10::/32' + - address: '2001:db30::/32' + - address: '2001:db50::/32' + - area_id: '4' + range: + - address: '2001:db60::/32' + state: replaced # # # ------------------------- @@ -360,25 +358,24 @@ EXAMPLES = """ # # - name: Render the commands for provided configuration - vyos.vyos.vyos_ospfv3: - config: - redistribute: - - route_type: 'bgp' - parameters: - router_id: '192.0.2.10' - areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' - - range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' - range: - - address: '2001:db40::/32' - state: rendered + vyos.vyos.vyos_ospfv3: + config: + redistribute: + - route_type: 'bgp' + parameters: + router_id: '192.0.2.10' + areas: + - area_id: '2' + export_list: 'export1' + import_list: 'import1' + range: + - address: '2001:db10::/32' + - address: '2001:db20::/32' + - address: '2001:db30::/32' + - area_id: '3' + range: + - address: '2001:db40::/32' + state: rendered # # # ------------------------- @@ -405,9 +402,9 @@ EXAMPLES = """ # # - name: Parse the commands to provide structured configuration. - vyos.vyos.vyos_ospfv3: - running_config: - "set protocols ospfv3 area 2 export-list 'export1' + vyos.vyos.vyos_ospfv3: + running_config: + "set protocols ospfv3 area 2 export-list 'export1' set protocols ospfv3 area 2 import-list 'import1' set protocols ospfv3 area 2 range '2001:db10::/32' set protocols ospfv3 area 2 range '2001:db20::/32' @@ -415,7 +412,7 @@ set protocols ospfv3 area 2 range '2001:db30::/32' set protocols ospfv3 area 3 range '2001:db40::/32' set protocols ospfv3 parameters router-id '192.0.2.10' set protocols ospfv3 redistribute 'bgp'" - state: parsed + state: parsed # # # ------------------------- @@ -477,9 +474,9 @@ set protocols ospfv3 redistribute 'bgp'" # set protocols ospfv3 redistribute 'bgp' # - name: Gather ospfv3 routes config with provided configurations - vyos.vyos.vyos_ospfv3: - config: - state: gathered + vyos.vyos.vyos_ospfv3: + config: + state: gathered # # # ------------------------- @@ -553,9 +550,9 @@ set protocols ospfv3 redistribute 'bgp'" # set protocols ospfv3 redistribute 'bgp' # - name: Delete attributes of ospfv3 routes. - vyos.vyos.vyos_ospfv3: - config: - state: deleted + vyos.vyos.vyos_ospfv3: + config: + state: deleted # # # ------------------------ diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml index d400ff1..55bec18 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml @@ -7,7 +7,7 @@ - block: - - name: Delete attributes of firewall. + - name: Delete ospfv3 routes register: result vyos.vyos.vyos_ospfv3: &id001 config: @@ -29,7 +29,7 @@ that: - "{{ deleted['after'] == result['after'] }}" - - name: Delete attributes of given interfaces (IDEMPOTENT) + - name: Delete ospfv3 routes (IDEMPOTENT) register: result vyos.vyos.vyos_ospfv3: *id001 diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/merged_update.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/merged_update.yaml index a65cfaf..0d506b3 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/merged_update.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/merged_update.yaml @@ -58,4 +58,4 @@ - "{{ merged_update['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml
\ No newline at end of file + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_ospfv3/vars/main.yaml b/tests/integration/targets/vyos_ospfv3/vars/main.yaml index d384e2a..6ded89a 100644 --- a/tests/integration/targets/vyos_ospfv3/vars/main.yaml +++ b/tests/integration/targets/vyos_ospfv3/vars/main.yaml @@ -13,42 +13,44 @@ merged: - set protocols ospfv3 area '3' - set protocols ospfv3 area 3 range 2001:db40::/32 after: - areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' - range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' - range: - - address: '2001:db40::/32' - parameters: - router_id: '192.0.2.10' - redistribute: - - route_type: 'bgp' + areas: + - area_id: '2' + export_list: 'export1' + import_list: 'import1' + range: + - address: '2001:db10::/32' + - address: '2001:db20::/32' + - address: '2001:db30::/32' + - area_id: '3' + range: + - address: '2001:db40::/32' + parameters: + router_id: '192.0.2.10' + redistribute: + - route_type: 'bgp' + merged_update: commands: - set protocols ospfv3 area 3 range 2001:db70::/32 after: - areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' - range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' - range: - - address: '2001:db40::/32' - - address: '2001:db70::/32' - parameters: - router_id: '192.0.2.10' - redistribute: - - route_type: 'bgp' + areas: + - area_id: '2' + export_list: 'export1' + import_list: 'import1' + range: + - address: '2001:db10::/32' + - address: '2001:db20::/32' + - address: '2001:db30::/32' + - area_id: '3' + range: + - address: '2001:db40::/32' + - address: '2001:db70::/32' + parameters: + router_id: '192.0.2.10' + redistribute: + - route_type: 'bgp' + populate: areas: - area_id: '2' |