Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/netvisor/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_access_list_ip.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: pn_access_list_ip
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to add/remove access-list-ip
description:
  - This modules can be used to add and remove IPs associated with access list.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: False
    type: str
  state:
    description:
      - State the action to perform. Use 'present' to add access-list-ip and
        'absent' to remove access-list-ip.
    required: True
    choices: ["present", "absent"]
  pn_ip:
    description:
      - IP associated with the access list.
    required: False
    default: '::'
    type: str
  pn_name:
    description:
      - Access List Name.
    required: False
    type: str
s'
- name: access list ip functionality
  pn_access_list_ip:
    pn_cliswitch: "sw01"
    pn_name: "foo"
    pn_ip: "172.16.3.1"
    state: "present"

- name: access list ip functionality
  pn_access_list_ip:
    pn_cliswitch: "sw01"
    pn_name: "foo"
    pn_ip: "172.16.3.1"
    state: "absent"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the access-list-ip command.
  returned: always
  type: list
stderr:
  description: set of error responses from the access-list-ip command.
  returned: on error
  type: list
changed:
  description: indicates whether the CLI caused changes on the target.
  returned: always
  type: bool
(t
AnsibleModule(tpn_clitrun_cli(trun_commandscC`s�|jd}|jd}|}|d|7}t||�d}||krj|jdtdd|�n|}|d|7}t||�d}|j�}||kr�tStS(	s�
    This method checks for idempotency using the access-list-ip-show command.
    If ip  exists, return True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_nametpn_ips* access-list-show name %s no-show-headers itfailedtmsgs'access-list with name %s does not exists6 access-list-ip-show name %s format ip no-show-headers(tparamsRt	fail_jsontTruetsplittFalse(tmoduletclitnametiptclicopytout((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_access_list_ip.pyt	check_cliWs

	c	C`s�tdddd�}tdtdtdtdd	�d
tdtdd	d|j��dtdtdd	d
d�dtdtdd	��dd
ddggd
dddggf�}|jd}|jd
}|jd}|jd}||}t||�}t||�}|d||f7}|dkrs|tkrY|jdtdd|�n|r�|d|7}q�nO|dkr�|tkr�|jdtdd|�q�n|r�|d|7}nt	|||�dS(s' This section is for arguments parsing tpresentsaccess-list-ip-addtabsentsaccess-list-ip-removet
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicesR
tdefaults::Rtrequired_ifs %s name %s tskippedRs%access-list with ip %s does not exists ip s%access list with ip %s already existsN(
tdictRRRtkeysRR	Rt	exit_jsonR
(	t	state_mapRt	cliswitchR#RRtcommandRt	IP_EXISTS((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_access_list_ip.pytmainssF	




		t__main__N(t
__future__RRRR!t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR/t__name__(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_access_list_ip.pyt<module>s


"		9

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]