Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Open vSwitch bond management module #58

Merged
merged 8 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Name | Description
[openvswitch.openvswitch.openvswitch_bridge](https://github.com/ansible-collections/openvswitch.openvswitch/blob/main/docs/openvswitch.openvswitch.openvswitch_bridge_module.rst)|Manage Open vSwitch bridges
[openvswitch.openvswitch.openvswitch_db](https://github.com/ansible-collections/openvswitch.openvswitch/blob/main/docs/openvswitch.openvswitch.openvswitch_db_module.rst)|Configure open vswitch database.
[openvswitch.openvswitch.openvswitch_port](https://github.com/ansible-collections/openvswitch.openvswitch/blob/main/docs/openvswitch.openvswitch.openvswitch_port_module.rst)|Manage Open vSwitch ports
[openvswitch.openvswitch.openvswitch_bond](https://github.com/ansible-collections/openvswitch.openvswitch/blob/main/docs/openvswitch.openvswitch.openvswitch_bond_module.rst)|Manage Open vSwitch bonds

<!--end collection content-->

Expand Down
3 changes: 3 additions & 0 deletions changelogs/fragments/1-openvswitch_bond-new-module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
major_changes:
- openvswitch_bond - New module for managing Open vSwitch bonds (https://github.com/ansible-collections/openvswitch.openvswitch/pull/58).
318 changes: 318 additions & 0 deletions docs/openvswitch.openvswitch.openvswitch_bond_module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
.. _openvswitch.openvswitch.openvswitch_bond_module:


****************************************
openvswitch.openvswitch.openvswitch_bond
****************************************

**Manage Open vSwitch bonds**


Version added: 1.0.6

.. contents::
:local:
:depth: 1


Synopsis
--------
- Manage Open vSwitch bonds



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

- ovs-vsctl


Parameters
----------

.. raw:: html

<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>bridge</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>Name of bridge to manage</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>port</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>Name of port (bond) to manage on the bridge</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>interfaces</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>List of interfaces to add to the bond</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>bond-mode</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>active-backup</b>&nbsp;&larr;</div></li>
<li>balance-tcp</li>
<li>balance-slb</li>
</ul>
</td>
<td>
<div>Sets the bond mode</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>lacp</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>active</b>&nbsp;&larr;</div></li>
<li>passive</li>
<li>off</li>
</ul>
</td>
<td>
<div>Sets the bond mode</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>bond_updelay</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">int</span>
</div>
</td>
<td>
</td>
<td>
<div>Number of milliseconds a link must be up to be activated (to prevent flapping)</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>bond_downdelay</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">int</span>
</div>
</td>
<td>
</td>
<td>
<div>Number of milliseconds a link must be down to be activated (to prevent flapping)</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>present</b>&nbsp;&larr;</div></li>
<li>absent</li>
</ul>
</td>
<td>
<div>Whether the bond should exist</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>timeout</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">int</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">5</div>
</td>
<td>
<div>How long to wait for ovs-vswitchd to respond in seconds</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>external_ids</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">dictionary</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">{}</div>
</td>
<td>
<div>Dictionary of external_ids applied to a port (bond).</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>other_config</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">dictionary</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">{}</div>
</td>
<td>
<div>Dictionary of other_config applied to a port (bond).</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>set</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>Sets one or more properties on a port (bond).</div>
</td>
</tr>
</table>
<br/>




Examples
--------

.. code-block:: yaml+jinja

# Create an active-backup bond using eth4 and eth5 on bridge br-ex
- openvswitch.openvswitch.openvswitch_bond:
bridge: br-ex
port: bond1
interfaces:
- eth4
- eth5
state: present

# Delete bond1 from bridge br-ex
- openvswitch.openvswitch.openvswitch_bond:
bridge: br-ex
port: bond1
state: absent

# Create an active LACP bond using eth4 and eth5 on bridge br-ex
- openvswitch.openvswitch.openvswitch_bond:
bridge: br-ex
port: bond1
interfaces:
- eth4
- eth5
lacp: active
state: present

# Configure bond with miimon link monitoring at 100 millisecond intervals
# NOTE: other_config values of integer type must be represented
# as literal strings
- openvswitch.openvswitch.openvswitch_bond:
bridge: br-ex
port: bond1
interfaces:
- eth4
- eth5
bond_updelay: 100
bond_downdelay: 100
state: present
args:
other_config:
bond-detect-mode: miimon
bond-miimon-interval: '"100"'

# Create an active LACP bond using DPDK interfaces
- openvswitch.openvswitch.openvswitch_bond:
bridge: br-provider
port: dpdkbond
interfaces:
- "0000:04:00.0"
- "0000:04:00.1"
lacp: active
set:
- "interface 0000:04:00.0 type=dpdk options:dpdk-devargs=0000:04:00.0"
- "interface 0000:04:00.1 type=dpdk options:dpdk-devargs=0000:04:00.1"
state: present



Status
------


Authors
~~~~~~~

- James Denton (@busterswt)
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ plugin_routing:
redirect: openvswitch.openvswitch.openvswitch_db
port:
redirect: openvswitch.openvswitch.openvswitch_port
bond:
redirect: openvswitch.openvswitch.openvswitch_bond