summaryrefslogtreecommitdiff
path: root/plugins/modules/vyos_vlan.py
diff options
context:
space:
mode:
authorGomathiselviS <gomathiselvi@gmail.com>2020-07-24 16:16:03 -0400
committerGitHub <noreply@github.com>2020-07-24 20:16:03 +0000
commitfbb82a0875dacc8200d3f663c3286104d0a1afbf (patch)
treeae507874333cff6aea4e71e4032959e1168eb036 /plugins/modules/vyos_vlan.py
parenta387c0878535f6af1d19800ff5bb2d60fa2f4e8a (diff)
downloadvyos.vyos-fbb82a0875dacc8200d3f663c3286104d0a1afbf.tar.gz
vyos.vyos-fbb82a0875dacc8200d3f663c3286104d0a1afbf.zip
[vyos] Fix sanity issues (#58)
[vyos] Fix sanity issues Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'plugins/modules/vyos_vlan.py')
-rw-r--r--plugins/modules/vyos_vlan.py59
1 files changed, 54 insertions, 5 deletions
diff --git a/plugins/modules/vyos_vlan.py b/plugins/modules/vyos_vlan.py
index a271dd43..81f4de1b 100644
--- a/plugins/modules/vyos_vlan.py
+++ b/plugins/modules/vyos_vlan.py
@@ -23,29 +23,76 @@ options:
name:
description:
- Name of the VLAN.
+ type: str
address:
description:
- Configure Virtual interface address.
+ type: str
vlan_id:
description:
- ID of the VLAN. Range 0-4094.
- required: true
+ type: int
interfaces:
description:
- List of interfaces that should be associated to the VLAN.
- required: true
+ type: list
+ elements: str
associated_interfaces:
description:
- This is a intent option and checks the operational state of the for given vlan
C(name) for associated interfaces. If the value in the C(associated_interfaces)
does not match with the operational state of vlan on device it will result in
failure.
+ type: list
+ elements: str
delay:
description:
- Delay the play should wait to check for declarative intent params values.
default: 10
+ type: int
aggregate:
description: List of VLANs definitions.
+ type: list
+ elements: dict
+ suboptions:
+ name:
+ description:
+ - Name of the VLAN.
+ type: str
+ address:
+ description:
+ - Configure Virtual interface address.
+ type: str
+ vlan_id:
+ description:
+ - ID of the VLAN. Range 0-4094.
+ type: int
+ required: true
+ interfaces:
+ description:
+ - List of interfaces that should be associated to the VLAN.
+ type: list
+ elements: str
+ required: true
+ associated_interfaces:
+ description:
+ - This is a intent option and checks the operational state of the for given vlan
+ C(name) for associated interfaces. If the value in the C(associated_interfaces)
+ does not match with the operational state of vlan on device it will result in
+ failure.
+ type: list
+ elements: str
+ delay:
+ description:
+ - Delay the play should wait to check for declarative intent params values.
+ type: int
+ state:
+ description:
+ - State of the VLAN configuration.
+ type: str
+ choices:
+ - present
+ - absent
purge:
description:
- Purge VLANs not defined in the I(aggregate) parameter.
@@ -55,6 +102,7 @@ options:
description:
- State of the VLAN configuration.
default: present
+ type: str
choices:
- present
- absent
@@ -305,14 +353,15 @@ def main():
vlan_id=dict(type="int"),
name=dict(),
address=dict(),
- interfaces=dict(type="list"),
- associated_interfaces=dict(type="list"),
+ interfaces=dict(type="list", elements="str"),
+ associated_interfaces=dict(type="list", elements="str"),
delay=dict(default=10, type="int"),
state=dict(default="present", choices=["present", "absent"]),
)
aggregate_spec = deepcopy(element_spec)
-
+ aggregate_spec["vlan_id"].update(required=True)
+ aggregate_spec["interfaces"].update(required=True)
# remove default in aggregate spec, to handle common arguments
remove_default_spec(aggregate_spec)