W3cubDocs

/Ansible

cl_bridge - Configures a bridge port on Cumulus Linux

New in version 2.1.

Synopsis

Configures a bridge interface on Cumulus Linux To configure a bond port use the cl_bond module. To configure any other type of interface use the cl_interface module. Follow the guidelines for bridging found in the Cumulus User Guide at http://docs.cumulusnetworks.com

Requirements (on host that executes module)

  • Alternate Debian network interface manager ifupdown2 @ github.com/CumulusNetworks/ifupdown2

Options

parameter required default choices comments
addr_method
no
  • dhcp
Configures the port to use DHCP. To enable this feature use the option dhcp.
alias_name
no
Description of the port.
ipv4
no
List of IPv4 addresses to configure on the interface. In the form X.X.X.X/YY.
ipv6
no
List of IPv6 addresses to configure on the interface. In the form X:X:X::X/YYY.
location
no [u'/etc/network/interfaces.d']
Interface directory location.
mstpctl_treeprio
no
Set spanning tree root priority. Must be a multiple of 4096.
mtu
no
Set MTU. Configure Jumbo Frame by setting MTU to 9000.
name
yes
Name of the interface.
ports
yes
List of bridge members.
pvid
no
In vlan-aware mode, defines vlan that is the untagged vlan.
stp
no yes
  • yes
  • no
Enables spanning tree Protocol. As of Cumulus Linux 2.5 the default bridging mode, only per vlan RSTP or 802.1d is supported. For the vlan aware mode, only common instance STP is supported
vids
no
In vlan-aware mode, lists VLANs defined under the interface.
virtual_ip
no
Define IPv4 virtual IP used by the Cumulus Linux VRR feature.
virtual_mac
no
Define Ethernet mac associated with Cumulus Linux VRR feature.
vlan_aware
no
  • yes
  • no
Enables vlan-aware mode.

Examples

# Options ['virtual_mac', 'virtual_ip'] are required together
# configure a bridge vlan aware bridge.
cl_bridge: name=br0  ports='swp1-12' vlan_aware='yes'
notify: reload networking

# configure bridge interface to define a default set of vlans
cl_bridge: name=bridge ports='swp1-12' vlan_aware='yes' vids='1-100'
notify: reload networking

# define cl_bridge once in tasks file
# then write interface config in variables file
# with just the options you want.
cl_bridge:
  name: "{{ item.key }}"
  ports: "{{ item.value.ports }}"
  vlan_aware: "{{ item.value.vlan_aware|default(omit) }}"
  ipv4:  "{{ item.value.ipv4|default(omit) }}"
  ipv6: "{{ item.value.ipv6|default(omit) }}"
  alias_name: "{{ item.value.alias_name|default(omit) }}"
  addr_method: "{{ item.value.addr_method|default(omit) }}"
  mtu: "{{ item.value.mtu|default(omit) }}"
  vids: "{{ item.value.vids|default(omit) }}"
  virtual_ip: "{{ item.value.virtual_ip|default(omit) }}"
  virtual_mac: "{{ item.value.virtual_mac|default(omit) }}"
  mstpctl_treeprio: "{{ item.value.mstpctl_treeprio|default(omit) }}"
with_dict: cl_bridges
notify: reload networking

# In vars file
# ============
cl_bridge:
    br0:
        alias_name: 'vlan aware bridge'
        ports: ['swp1', 'swp3']
        vlan_aware: true
        vids: ['1-100']

Return Values

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

name description returned type sample
msg human-readable report of success or failure always string interface bond0 config updated
changed whether the interface was changed changed bool True

Notes

Note

As this module writes the interface directory location, ensure that /etc/network/interfaces has a ‘source /etc/network/interfaces.d/*’ or whatever path is mentioned in the location attribute.

Note

For the config to be activated, i.e installed in the kernel, “service networking reload” needs be be executed. See EXAMPLES section.

This is a Core Module

For more information on what this means please read Core Modules

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

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