Provision dockerbox in Vagrant and setup network
This commit is contained in:
10
roles/base/files/network-interfaces.cfg
Normal file
10
roles/base/files/network-interfaces.cfg
Normal file
@@ -0,0 +1,10 @@
|
||||
# Ansible managed
|
||||
|
||||
# This file describes the network interfaces available on your system
|
||||
# and how to activate them. For more information, see interfaces(5).
|
||||
|
||||
source /etc/network/interfaces.d/*
|
||||
|
||||
# The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
@@ -3,14 +3,24 @@
|
||||
name: ["vim", "wget"]
|
||||
state: present
|
||||
|
||||
- name: Install network interfaces file
|
||||
copy:
|
||||
src: network-interfaces.cfg
|
||||
dest: /etc/network/interfaces
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: manage_network
|
||||
|
||||
- name: Install network interfaces
|
||||
template:
|
||||
src: "{{ network_type }}-interface.cfg"
|
||||
dest: /etc/network/interfaces
|
||||
dest: "/etc/network/interfaces.d/{{ ip_inter }}"
|
||||
notify: reboot_host
|
||||
when: manage_network
|
||||
|
||||
- name: Install bridge utilities
|
||||
apt:
|
||||
name: bridge-utils
|
||||
state: present
|
||||
when: network_type == "bridged"
|
||||
when: network_type == "bridged" and manage_network
|
||||
|
@@ -1,9 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
auto br1
|
||||
iface br1 inet static
|
||||
|
@@ -1,9 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
auto {{ ip_inter }}
|
||||
iface {{ ip_inter }} inet static
|
||||
|
Reference in New Issue
Block a user