btravouillon.ifupdown

Table of Contents generated with DocToc

ifupdown

This is an Ansible role that helps you set up network connections.

  • Configure DHCP, static, and manual connections
  • Create VLANs, bonds, bridges, and other network interfaces
  • Support for Open vSwitch network settings

This role is based on a previous project called config-interfaces, but they are not the same. If you want to switch between them, you must update your inventory.

Requirements

Check the Example Playbook for ways to set up different network configurations.

NOTE: To create Open vSwitch configurations, you will need to use the ansible-openvswitch Ansible role

Role Variables

For role variables, see defaults/main.yml.

Dependencies

If you are using a wireless interface, be sure to specify that and provide the SSID and password.

Example Playbook

See the Example Playbook for guidance.

Examples

Example (standard) /etc/network/interfaces

# Managed by Ansible
# Changes here will be lost

auto lo
iface lo inet loopback

########## Network Interfaces
auto enp0s3
iface enp0s3 inet dhcp
  pre-up sleep 2

auto enp0s8
iface enp0s8 inet static
  address 192.168.250.10
  netmask 255.255.255.0

# Member of bond0
auto enp0s9
iface enp0s9 inet manual
  bond_master bond0

# Member of bond0
auto enp0s10
iface enp0s10 inet manual
  bond_master bond0

# Member of br0
auto enp0s16
iface enp0s16 inet manual

########## End of Network Interfaces

########## Network Bonds
# Bond Group 0
auto bond0
iface bond0 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  bond_slaves enp0s9 enp0s10
  bond_primary enp0s9
  bond_mode active-backup
  bond_miimon 100

########## End of Network Bonds

########## Network Bridges
# Bridge 0
auto br0
iface br0 inet static
  address 192.168.1.11
  netmask 255.255.255.0
  bridge_stp off
  bridge_fd 0
  bridge_ports enp0s16

########## End of Network Bridges

dns-nameservers 8.8.8.8 8.8.4.4
dns-search test.vagrant.local

Example (Open vSwitch) /etc/network/interfaces

# Managed by Ansible
# Changes here will be lost

auto lo
iface lo inet loopback

########## Network Interfaces
auto enp0s3
iface enp0s3 inet dhcp
  pre-up sleep 2

auto enp0s8
iface enp0s8 inet static
  address 192.168.250.10
  netmask 255.255.255.0

########## End of Network Interfaces

########## OVS Bonds
# OVS Bond
allow-vmbr0 bond0
iface bond0 inet manual
  ovs_bridge vmbr0
  ovs_type OVSBond
  ovs_bonds enp0s9 enp0s10
  ovs_options bond_mode=active-backup lacp=off

########## End of OVS Bonds

########## OVS Bridges
# OVS Bridge
auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
  ovs_type OVSBridge
  ovs_ports bond0 vlan1

########## End of OVS Bridges

########## OVS Interfaces
# VLAN1
allow-vmbr0 vlan1
iface vlan1 inet static
  address 192.168.250.100
  netmask 255.255.255.0
  ovs_bridge vmbr0
  ovs_type OVSIntPort

########## End of OVS Interfaces

dns-nameservers 8.8.8.8 8.8.4.4
dns-search test.vagrant.local

License

This project uses the MIT license.

Author Information

Bruno Travouillon

Original Author Information

Larry Smith Jr.

Informazioni sul progetto

An [Ansible](https://www.ansible.com) role to configure network interfaces

Installa
ansible-galaxy install btravouillon.ifupdown
Licenza
mit
Download
901
Proprietario