Support for Open vSwitch - module with basic Open vSwitch commands.
Suitable for setting up Openstack Neutron.
Jiri Kotlin <jiri.kotlin@ultimum.io>
salt.modules.openvswitch.
bridge_create
(br, may_exist=True)¶Creates a new bridge.
br -- A string - bridge name
may_exist -- Bool, if False - attempting to create a bridge that exists returns False.
True on success, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.bridge_create br0
salt.modules.openvswitch.
bridge_delete
(br, if_exists=True)¶Deletes bridge and all of its ports.
br -- A string - bridge name
if_exists -- Bool, if False - attempting to delete a bridge that does not exist returns False.
True on success, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.bridge_delete br0
salt.modules.openvswitch.
bridge_exists
(br)¶Tests whether bridge exists as a real or fake bridge.
True if Bridge exists, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.bridge_exists br0
salt.modules.openvswitch.
bridge_list
()¶Lists all existing real and fake bridges.
List of bridges (or empty list), False on failure.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.bridge_list
salt.modules.openvswitch.
interface_get_options
(port)¶Port's interface's optional parameters.
port -- A string - port name.
String containing optional parameters of port's interface, False on failure.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.interface_get_options tap0
salt.modules.openvswitch.
interface_get_type
(port)¶Type of port's interface.
port -- A string - port name.
String - type of interface or empty string, False on failure.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.interface_get_type tap0
salt.modules.openvswitch.
port_add
(br, port, may_exist=False, internal=False)¶Creates on bridge a new port named port.
True on success, else False.
br -- A string - bridge name
port -- A string - port name
may_exist -- Bool, if False - attempting to create a port that exists returns False.
internal -- A boolean to create an internal interface if one does not exist.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_add br0 8080
salt.modules.openvswitch.
port_create_gre
(br, port, id, remote)¶Generic Routing Encapsulation - creates GRE tunnel between endpoints.
br -- A string - bridge name.
port -- A string - port name.
id -- An integer - unsigned 32-bit number, tunnel's key.
remote -- A string - remote endpoint's IP address.
True on success, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_create_gre br0 gre1 5001 192.168.1.10
salt.modules.openvswitch.
port_create_vlan
(br, port, id, internal=False)¶Isolate VM traffic using VLANs.
br -- A string - bridge name.
port -- A string - port name.
id -- An integer in the valid range 0 to 4095 (inclusive), name of VLAN.
internal -- A boolean to create an internal interface if one does not exist.
True on success, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_create_vlan br0 tap0 100
salt.modules.openvswitch.
port_create_vxlan
(br, port, id, remote, dst_port=None)¶Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints.
br -- A string - bridge name.
port -- A string - port name.
id -- An integer - unsigned 64-bit number, tunnel's key.
remote -- A string - remote endpoint's IP address.
dst_port -- An integer - port to use when creating tunnelport in the switch.
True on success, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_create_vxlan br0 vx1 5001 192.168.1.10 8472
salt.modules.openvswitch.
port_get_tag
(port)¶Lists tags of the port.
port -- A string - port name.
List of tags (or empty list), False on failure.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_get_tag tap0
salt.modules.openvswitch.
port_list
(br)¶Lists all of the ports within bridge.
br -- A string - bridge name.
List of bridges (or empty list), False on failure.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_list br0
salt.modules.openvswitch.
port_remove
(br, port, if_exists=True)¶Deletes port.
br -- A string - bridge name (If bridge is None, port is removed from whatever bridge contains it)
port -- A string - port name.
if_exists -- Bool, if False - attempting to delete a por that does not exist returns False. (Default True)
True on success, else False.
New in version 2016.3.0.
CLI Example: .. code-block:: bash
salt '*' openvswitch.port_remove br0 8080