community.general.ce_acl_interface (0.1.1) — module

Manages applying ACLs to interfaces on HUAWEI CloudEngine switches.

Authors: wangdezhuang (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manages applying ACLs to interfaces on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: CloudEngine acl interface test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Apply acl to interface"
    ce_acl_interface:
      state: present
      acl_name: 2000
      interface: 40GE1/0/1
      direction: outbound
      provider: "{{ cli }}"

  - name: "Undo acl from interface"
    ce_acl_interface:
      state: absent
      acl_name: 2000
      interface: 40GE1/0/1
      direction: outbound
      provider: "{{ cli }}"

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - Determines whether the config should be present or not on the device.
    required: false

acl_name:
    description:
    - ACL number or name. For a numbered rule group, the value ranging from 2000 to 4999.
      For a named rule group, the value is a string of 1 to 32 case-sensitive characters
      starting with a letter, spaces not supported.
    required: true

direction:
    choices:
    - inbound
    - outbound
    description:
    - Direction ACL to be applied in on the interface.
    required: true

interface:
    description:
    - Interface name. Only support interface full name, such as "40GE2/0/1".
    required: true

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
end_state:
  description: k/v pairs of aaa params after module execution
  returned: always
  sample:
    acl interface:
    - traffic-filter acl lb inbound
    - traffic-filter acl 2000 outbound
  type: dict
existing:
  description: k/v pairs of existing aaa server
  returned: always
  sample:
    acl interface: traffic-filter acl lb inbound
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    acl_name: '2000'
    direction: outbound
    interface: 40GE2/0/1
    state: present
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - interface 40ge2/0/1
  - traffic-filter acl 2000 outbound
  type: list