�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys
---
module: pn_ipv6security_raguard_port
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.9"
short_description: CLI command to add/remove ipv6security-raguard-port
description:
- This module can be used to add ports to RA Guard Policy and remove ports to RA Guard Policy.
options:
pn_cliswitch:
description:
- Target switch to run the CLI on.
required: false
type: str
state:
description:
- ipv6security-raguard-port configuration command.
required: false
type: str
choices: ['present', 'absent']
default: 'present'
pn_name:
description:
- RA Guard Policy Name.
required: true
type: str
pn_ports:
description:
- Ports attached to RA Guard Policy.
required: true
type: str
s#
- name: ipv6 security raguard port add
pn_ipv6security_raguard_port:
pn_cliswitch: "sw01"
pn_name: "foo"
pn_ports: "1"
- name: ipv6 security raguard port remove
pn_ipv6security_raguard_port:
pn_cliswitch: "sw01"
pn_name: "foo"
state: "absent"
pn_ports: "1"
s�
command:
description: the CLI command run on the target node.
returned: always
type: str
stdout:
description: set of responses from the ipv6security-raguard-port command.
returned: always
type: list
stderr:
description: set of error responses from the ipv6security-raguard-port command.
returned: on error
type: list
changed:
description: indicates whether the CLI caused changes on the target.
returned: always
type: bool
( t
AnsibleModule( t pn_clit run_cli( t run_commandsc C` sO | j d } d } t | | � d } | r; | j � } n | | k rK t St S( s�
This method checks for idempotency using the ipv6security-raguard-show command.
If a name exists, return True if name exists else False.
:param module: The Ansible module to fetch input parameters
:param cli: The CLI string
t pn_names6 ipv6security-raguard-show format name parsable-delim ,i ( t paramsR t splitt Truet False( t modulet namet clit out( ( sa /usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_ipv6security_raguard_port.pyt check_cliV s
c
C` sI t d d d d � } t d t d t d d � d t d t d d d
| j � d d � d t d t d d � d
t d t d d � � } t d | � } | j d } | j d } | j d } | j d
} | | } t | | � } t | � } | r| t k r| j d t d d | � qn | d | | | f 7} t | | | � d S( s'