Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrlesmithjr/ansible-config-interfaces
https://github.com/mrlesmithjr/ansible-config-interfaces
ansible bond bridge
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mrlesmithjr/ansible-config-interfaces
- Owner: mrlesmithjr
- License: mit
- Created: 2015-08-06T19:07:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T03:44:34.000Z (9 months ago)
- Last Synced: 2024-10-20T01:16:31.219Z (4 months ago)
- Topics: ansible, bond, bridge
- Language: Jinja
- Size: 60.5 KB
- Stars: 36
- Watchers: 5
- Forks: 34
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
**Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_
- [ansible-config-interfaces](#ansible-config-interfaces)
- [Requirements](#requirements)
- [Role Variables](#role-variables)
- [Dependencies](#dependencies)
- [Example Playbook](#example-playbook)
- [Examples](#examples)
- [Example (standard) `/etc/network/interfaces`:](#example-standard-etcnetworkinterfaces)
- [Example (Open vSwitch) `/etc/network/interfaces`:](#example-open-vswitch-etcnetworkinterfaces)
- [License](#license)
- [Author Information](#author-information)# ansible-config-interfaces
An [Ansible](https://www.ansible.com) role to configure network interfaces
- Define dhcp, static, and manual settings
- Create VLAN, bonds, bridges, and interfaces
- Create Open vSwitch bridges, bonds, and interfaces## Requirements
See [Example Playbook](#example-playbook) for examples of how to define specific
network configurations.> NOTE: If creating Open vSwitch configurations you will need to use the [ansible-openvswitch](https://github.com/mrlesmithjr/ansible-openvswitch) [Ansible](https://www.ansible.com) role
## Role Variables
[defaults/main.yml](defaults/main.yml)
## Dependencies
If interface is wireless you will need to define as such as well as provide the
SSID and key.## Example Playbook
[Example Playbook](playbook.yml)
## Examples
### Example (standard) `/etc/network/interfaces`
```bash
# Ansible managed
# Any changes made here will be lostauto lo
iface lo inet loopback########## Network Interfaces
auto enp0s3
iface enp0s3 inet dhcp
pre-up sleep 2auto enp0s8
iface enp0s8 inet static
address 192.168.250.10
netmask 255.255.255.0# bond0 member
auto enp0s9
iface enp0s9 inet manual
bond_master bond0# bond0 member
auto enp0s10
iface enp0s10 inet manual
bond_master bond0# br0 member
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 enp010
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`
```bash
# Ansible managed
# Any changes made here will be lostauto lo
iface lo inet loopback########## Network Interfaces
auto enp0s3
iface enp0s3 inet dhcp
pre-up sleep 2auto 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
MIT
## Author Information
Larry Smith Jr.
- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr)
- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com)
- [[email protected]](mailto:[email protected])