Skip to content

Commit

Permalink
playbooks/cluster_setup_network: create the cluster bridge
Browse files Browse the repository at this point in the history
Use Open vSwtich to create the cluster bridge.

Signed-off-by: Mathieu Dupré <[email protected]>
  • Loading branch information
dupremathieu authored and insatomcat committed Nov 16, 2022
1 parent 8c8da1a commit f249aac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions playbooks/cluster_setup_network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@
# configure VMs.

---

- name: Configure cluster network
hosts: cluster_machines
tasks:
- name: Remove team0 bridge in OVS
command: "/usr/bin/ovs-vsctl --if-exists del-br team0"
- name: Create team0 bridge in OVS
command: "/usr/bin/ovs-vsctl add-br team0"
- name: Enable RSTP on team0 bridge
command: "/usr/bin/ovs-vsctl set Bridge team0 rstp_enable=true"
- name: Set RSTP priority on team0 bridge
command: "/usr/bin/ovs-vsctl set Bridge team0 other_config=rstp-priority=16384"
- name: Add interface team0_0 to team0 bridge
command: "/usr/bin/ovs-vsctl -- --if-exists del-port {{ team0_0 }} -- add-port team0 {{ team0_0 }}"
- name: Add interface team0_1 to team0 bridge
command: "/usr/bin/ovs-vsctl -- --if-exists del-port {{ team0_1 }} -- add-port team0 {{ team0_1 }}"

- name: Configure OVS
hosts: hypervisors
vars:
Expand Down
2 changes: 1 addition & 1 deletion templates/ovs_configuration.json.j2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{% set OVS_configuration = ({ "bridges": ovs_bridges, "unbind_pci_address": unbind_pci_address | default([]) }) %}
{% set OVS_configuration = ({ "bridges": ovs_bridges, "ignored_bridges": ignored_bridges, "unbind_pci_address": unbind_pci_address | default([]) }) %}
{{ OVS_configuration | to_nice_json }}

0 comments on commit f249aac

Please sign in to comment.