stackhpc.vxlan

VXLAN

This role sets up VXLAN interfaces that stay active using either Network Scripts, NetworkManager, or Systemd-Networkd.

Role Variables

This role uses the same names for variables as Network Scripts. It's a good idea to read the documentation for Network Scripts. Below are the relevant variables you can use.

  • vxlan_vni: This sets the VXLAN network identifier for the interfaces.
  • vxlan_ttl: This defines how long packets can live while transmitted over the interface.
  • vxlan_phys_dev: This indicates the physical device the VXLAN interface connects to.
  • vxlan_dstport: This specifies the port number for the VXLAN.
  • vxlan_bootproto: This defines the protocol used when starting the interface (not supported with NetworkManager or Systemd-Networkd; always set to none).
  • vxlan_onboot: Set to yes if you want the VXLAN interface to start when the system boots, otherwise set to no (not supported with Systemd-networkd).
  • vxlan_interfaces: This is a list of interfaces to be created. You can specify each instance of the variables above, along with some others:
    • device: The name given to the VXLAN interface.
    • ipaddr: The IPV4 address for the VXLAN interface (not supported with NetworkManager or Systemd-Networkd).
    • prefix: The subnet mask for the ipaddr (not supported with NetworkManager or Systemd-Networkd).
    • group: The multicast group the VXLAN will use.
    • bridge: If set, this creates a bridge between the VXLAN and the mentioned interface.

By default, Network Scripts will be used unless they are not available. You can enforce the use of Network Scripts, NetworkManager, or Systemd-Networkd by setting force_ns, force_nm, or force_sd to true.

Example Playbook

Include this role in your playbook like any other role.

- hosts: host1
  roles:
    - role: vxlan
      vars:
        vxlan_vni: 10
        vxlan_interfaces:
          - device: vxlan0
            ipaddr: 192.168.0.2
            group: 224.0.0.100

For variables like vxlan_ipaddr, it's best to define them individually for each host.

/host_vars/host1

vxlan_interfaces:
  - device: vxlan0
    ipaddr: 192.168.0.2
    group: 224.0.0.100

/host_vars/host2

vxlan_interfaces:
  - device: vxlan0
    ipaddr: 192.168.0.3
    group: 224.0.0.100

You can also set up multiple VXLAN interfaces for each host, but each device in vxlan_interfaces must have a unique vxlan_vni.

/host_vars/host1

vxlan_interfaces:
  - device: vxlan0
    vni: 10
    group: 224.0.0.200
  - device: vxlan1
    vni: 20
    group: 224.0.0.200

You can also set a bridge for the VXLAN interface to connect through.

/host_vars/host1

vxlan_interfaces:
  - device: vxlan0
    group: 224.0.0.10
    bridge: breth1

License

Apache License 2.0

Author Information

StackHPC

Informazioni sul progetto

Create persistent VXLAN interfaces with the use of Network Scripts

Installa
ansible-galaxy install stackhpc.vxlan
Licenza
apache-2.0
Download
16.9k
Proprietario
StackHPC develops OpenStack capabilities for research computing use cases. Through extensive experience, we understand HPC and cloud.