W3cubDocs

/Ansible

ce_eth_trunk - Manages Eth-Trunk interfaces on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Manages Eth-Trunk specific configuration parameters on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
force
no
When true it forces Eth-Trunk members to match what is declared in the members param. This can be used to remove members.
hash_type
no
  • src-dst-ip
  • src-dst-mac
  • enhanced
  • dst-ip
  • dst-mac
  • src-ip
  • src-mac
Hash algorithm used for load balancing among Eth-Trunk member interfaces.
members
no
List of interfaces that will be managed in a given Eth-Trunk. The interface name must be full name.
min_links
no
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.
mode
no
  • manual
  • lacp-dynamic
  • lacp-static
Specifies the working mode of an Eth-Trunk interface.
state
no present
  • present
  • absent
Manage the state of the resource.
trunk_id
yes
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.

Examples

- 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 }}'

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
end_state
k/v pairs of Eth-Trunk info after module execution
always dict {'members_detail': [{'memberIfName': '10GE1/0/24', 'memberIfState': 'Down'}, {'memberIfName': '10GE1/0/25', 'memberIfState': 'Down'}], 'trunk_id': '100', 'mode': 'lacp-static', 'hash_type': 'mac', 'min_links': '1'}
changed
check to see if a change was made on the device
always boolean True
updates
command sent to the device
always list ['interface Eth-Trunk 100', 'mode lacp-static', 'interface 10GE1/0/25', 'eth-trunk 100']
proposed
k/v pairs of parameters passed into module
always dict {'trunk_id': '100', 'mode': 'lacp-static', 'members': ['10GE1/0/24', '10GE1/0/25']}
existing
k/v pairs of existing Eth-Trunk
always dict {'members_detail': [{'memberIfName': '10GE1/0/25', 'memberIfState': 'Down'}], 'trunk_id': '100', 'mode': 'manual', 'hash_type': 'mac', 'min_links': '1'}

Notes

Note

  • state=absent removes the Eth-Trunk config and interface if it already exists. If members to be removed are not explicitly passed, all existing members (if any), are removed, and Eth-Trunk removed.
  • Members must be a list.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/ce_eth_trunk_module.html