community.general.ce_eth_trunk (0.1.1) — module

Manages Eth-Trunk interfaces on HUAWEI CloudEngine switches.

Authors: QijunPan (@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 Eth-Trunk specific configuration parameters on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: eth_trunk module 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: Ensure Eth-Trunk100 is created, add two members, and set to mode lacp-static
    ce_eth_trunk:
      trunk_id: 100
      members: ['10GE1/0/24','10GE1/0/25']
      mode: 'lacp-static'
      state: present
      provider: '{{ cli }}'

Inputs

    
mode:
    choices:
    - manual
    - lacp-dynamic
    - lacp-static
    description:
    - Specifies the working mode of an Eth-Trunk interface.

force:
    default: 'no'
    description:
    - When true it forces Eth-Trunk members to match what is declared in the members param.
      This can be used to remove members.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Manage the state of the resource.

members:
    description:
    - List of interfaces that will be managed in a given Eth-Trunk. The interface name
      must be full name.

trunk_id:
    description:
    - Eth-Trunk interface number. The value is an integer. The value range depends on
      the assign forward eth-trunk mode command. When 256 is specified, the value ranges
      from 0 to 255. When 512 is specified, the value ranges from 0 to 511. When 1024
      is specified, the value ranges from 0 to 1023.
    required: true

hash_type:
    choices:
    - src-dst-ip
    - src-dst-mac
    - enhanced
    - dst-ip
    - dst-mac
    - src-ip
    - src-mac
    description:
    - Hash algorithm used for load balancing among Eth-Trunk member interfaces.

min_links:
    description:
    - Specifies the minimum number of Eth-Trunk member links in the Up state. The value
      is an integer ranging from 1 to the maximum number of interfaces that can be added
      to a Eth-Trunk interface.

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 Eth-Trunk info after module execution
  returned: always
  sample:
    hash_type: mac
    members_detail:
    - memberIfName: 10GE1/0/24
      memberIfState: Down
    - memberIfName: 10GE1/0/25
      memberIfState: Down
    min_links: '1'
    mode: lacp-static
    trunk_id: '100'
  type: dict
existing:
  description: k/v pairs of existing Eth-Trunk
  returned: always
  sample:
    hash_type: mac
    members_detail:
    - memberIfName: 10GE1/0/25
      memberIfState: Down
    min_links: '1'
    mode: manual
    trunk_id: '100'
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    members:
    - 10GE1/0/24
    - 10GE1/0/25
    mode: lacp-static
    trunk_id: '100'
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - interface Eth-Trunk 100
  - mode lacp-static
  - interface 10GE1/0/25
  - eth-trunk 100
  type: list