tenks/ansible/node_networking.yml
Mark Goddard ced8a4a528 Support linux bridge in addition to OVS
While OVS was used initially due to availability of a
networking-generic-switch driver for it, Linux bridge can be useful for
environments where OVS is not available.

This is configured via bridge_type variable. It defaults to
'openvswitch', but may be set to 'linuxbridge'.

Change-Id: I750a73cebc743edcbcd8c23c67e4920d0058bead
2020-03-13 11:12:37 +00:00

34 lines
1.0 KiB
YAML

---
- hosts: localhost
tags:
- node-networking
tasks:
- name: Load state from file
include_vars:
file: "{{ state_file_path }}"
name: tenks_state
- hosts: hypervisors
tags:
- node-networking
vars:
nodes: >-
{{ hostvars.localhost.tenks_state[inventory_hostname].nodes
| default([]) }}
tasks:
- name: Configure veth pairs for each node
include_role:
name: veth-pair
vars:
veth_pair_peer_bridge_type: "{{ bridge_type }}"
veth_pair_peer_bridge: "{{ physnet.1 | bridge_name }}"
veth_pair_peer_link_name: "{{ physnet.0 | peer_link_name(physnet.1) }}"
veth_pair_source_link_name: "{{ physnet.0 | source_link_name(physnet.1) }}"
veth_pair_state: "{{ physnet.0.get('state', 'present') }}"
# Loop over each physical network for each node allocated to this host.
# Allocations are stored in localhost's vars.
loop: >-
{{ nodes | subelements('physical_networks') }}
loop_control:
loop_var: physnet