Add static network interface

This commit is contained in:
Kris Lamoureux 2020-04-24 22:24:02 -04:00
parent 1c3355e052
commit ff709be0db
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1 @@
network_type: static

View File

@ -6,6 +6,7 @@
- name: Install network interfaces
template:
src: bridged-interface.cfg
src: {{ network_type }}-interface.cfg
dest: /etc/network/interfaces
notify: reboot_host
@ -13,3 +14,4 @@
apt:
name: bridge-utils
state: present
when: network_type == "bridged"

View File

@ -0,0 +1,11 @@
# {{ ansible_managed }}
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto {{ ip_inter }}
iface {{ ip_inter }} inet static
address {{ ip_addr }}
gateway {{ ip_gateway }}