�
�Udac @ s� i d d 6d g d 6d d 6Z d Z d Z d Z d d
l Z d d l m Z m Z d d l m Z m Z d d
l
m Z d � Z d � Z
d � Z d � Z d � Z e d k r� e � n d
S( s 1.1t metadata_versiont previewt statust networkt 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( t load_configt run_commands( t nxos_argument_spect
check_args( t
AnsibleModulec C s� i d j | j � � d 6d d 6g } t | | � } | d k rJ d } n | d k r_ d } n t j d j | | � t | d
� � } t | � S( Ns( show running-config aclmgr | section {0}t commandt textt outputt ingresst int egresst outs ip access-group {0} {1}i ( t formatt titleR t ret searcht strt bool( t modulet namet intft directionR
t bodyt mdirt match( ( sS /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pyt check_for_acl_int_presentV s
(c C s� g } | j d | j d � � | j d � } | d k rY d j | j d � d � } n* | d k r� d j | j d � d � } n | j | � | S(
Ns
interface t interfaceR R s ip access-group {0} {1}R R R
R ( t appendt getR ( t proposedt commandsR t cmd( ( sS /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_acl_interface.pyt apply_aclh s
c C s� g } | j d | j d � � | j d � } | d k rY d j | j d � d � } n* | d k r� d j | j d � d � } n | j | � | S(
Ns
interface R R R s no ip access-group {0} {1}R R R
R ( R R! R ( R"