W3cubDocs

/Ansible 2.9

openvswitch_port – Manage Open vSwitch ports

Synopsis

  • Manage Open vSwitch ports

Requirements

The below requirements are needed on the host that executes this module.

  • ovs-vsctl

Parameters

Parameter Choices/Defaults Comments
bridge
- / required
Name of bridge to manage
external_ids
-
Default:
{}
Dictionary of external_ids applied to a port.
port
- / required
Name of port to manage on the bridge
set
-
Set a single property on a port.
state
-
    Choices:
  • present
  • absent
Whether the port should exist
tag
-
VLAN tag for this port. Must be a value between 0 and 4095.
timeout
-
Default:
5
How long to wait for ovs-vswitchd to respond

Examples

# Creates port eth2 on bridge br-ex
- openvswitch_port:
    bridge: br-ex
    port: eth2
    state: present

# Creates port eth6
- openvswitch_port:
    bridge: bridge-loop
    port: eth6
    state: present
    set: Interface eth6

# Creates port vlan10 with tag 10 on bridge br-ex
- openvswitch_port:
    bridge: br-ex
    port: vlan10
    tag: 10
    state: present
    set: Interface vlan10

# Assign interface id server1-vifeth6 and mac address 00:00:5E:00:53:23
# to port vifeth6 and setup port to be managed by a controller.
- openvswitch_port:
    bridge: br-int
    port: vifeth6
    state: present
  args:
    external_ids:
      iface-id: '{{ inventory_hostname }}-vifeth6'
      attached-mac: '00:00:5E:00:53:23'
      vm-id: '{{ inventory_hostname }}'
      iface-status: active

Status

Red Hat Support

More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.

Authors

  • David Stygstra (@stygstra)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/openvswitch_port_module.html