Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/nxos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pyc

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZd	dlmZm	Z	d	d
l
mZd�Zd�Z
d�Zd�Zd�Zedkr�e�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys
---
module: nxos_acl_interface
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages applying ACLs to interfaces.
description:
  - Manages applying ACLs to interfaces.
author:
  - Jason Edelman (@jedelman8)
  - Gabriele Gerbino (@GGabriele)
options:
  name:
    description:
      - Case sensitive name of the access list (ACL).
    required: true
  interface:
    description:
      - Full name of interface, e.g. I(Ethernet1/1).
    required: true
  direction:
    description:
      - Direction ACL to be applied in on the interface.
    required: true
    choices: ['ingress', 'egress']
  state:
    description:
      - Specify desired state of the resource.
    required: false
    default: present
    choices: ['present','absent']
s�
- name: apply egress acl to ethernet1/41
  nxos_acl_interface:
    name: ANSIBLE
    interface: ethernet1/41
    direction: egress
    state: present
s�
acl_applied_to:
    description: list of interfaces the ACL is applied to
    returned: always
    type: list
    sample: [{"acl_type": "Router ACL", "direction": "egress",
            "interface": "Ethernet1/41", "name": "ANSIBLE"}]
commands:
    description: commands sent to the device
    returned: always
    type: list
    sample: ["interface ethernet1/41", "ip access-group ANSIBLE out"]
i����N(tload_configtrun_commands(tnxos_argument_spect
check_args(t
AnsibleModulecCs�idj|j��d6dd6g}t||�}|dkrJd}n|dkr_d}ntjd	j||�t|d
��}t|�S(Ns(show running-config aclmgr | section {0}tcommandttexttoutputtingresstintegresstoutsip access-group {0} {1}i(tformatttitleRtretsearchtstrtbool(tmoduletnametintft	directionR
tbodytmdirtmatch((sS/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pytcheck_for_acl_int_presentVs
		(cCs�g}|jd|jd��|jd�}|dkrYdj|jd�d�}n*|dkr�dj|jd�d	�}n|j|�|S(
Ns
interface t	interfaceRRsip access-group {0} {1}RRR
R(tappendtgetR(tproposedtcommandsRtcmd((sS/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pyt	apply_aclhs
cCs�g}|jd|jd��|jd�}|dkrYdj|jd�d�}n*|dkr�dj|jd�d	�}n|j|�|S(
Ns
interface RRRsno ip access-group {0} {1}RRR
R(R R!R(R"R#RR$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pyt
remove_aclvs
cCsGg}x:|D]2}t|t�r2|j|�q
|j|�q
W|S(N(t
isinstancetlisttextendR (t
command_liststflat_command_listR
((sS/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pytflatten_list�s
c

Cs4tdtdtdd�dtdt�dtdtddd	g�d
tdddgd
d��}|jt�td|dt�}t�}t||�tdtd|�}|jd
}|jd}|jdj	�}|jdj	�}td|d|d|�}t
||||�}	g}
g}|dkrf|	s�t|�}|rc|j|�qcq�n:|dkr�|	r�t
|�}|r�|j|�q�q�n|rt|�}
|
r|jr�|jdtd|
�qt||
�t|d<d|
kr|
jd�qqng}
|
|d<|j|�dS(NRtrequiredttypeRRRtchoicesRR
tstatetabsenttpresenttdefaultt
argument_spectsupports_check_modetchangedtwarningsR#t	configurei(tdicttFalsetTruetupdateRR	R(RtparamstlowerRR%R R&R,t
check_modet	exit_jsonRtpop(
R4RR7tresultsR0RRRR"texistingtcmdsR#R
((sS/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pytmain�sR
		


	


t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRt&ansible.module_utils.network.nxos.nxosRRRRtansible.module_utils.basicR	RR%R&R,REt__name__(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pyt<module>s 


"					
	;

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