Manage interfaces and update dependency check

Setup bridge networking, install useful packages and fix Ansible
dependency check.
This commit is contained in:
Kris Lamoureux 2020-03-05 02:06:21 -05:00
parent 8e546cc720
commit e425808b02
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
4 changed files with 35 additions and 1 deletions

View File

@ -1,7 +1,7 @@
- name: 'Install Ansible dependency: python3-apt'
shell: 'apt-get update && apt-get install python3-apt -y'
args:
creates: /usr/lib/python2.7/dist-packages/apt
creates: /usr/lib/python3/dist-packages/apt
warn: false
- name: 'Install Ansible dependency: aptitude'

View File

@ -0,0 +1,5 @@
- name: Reboot host
reboot:
msg: "Reboot initiated by Ansible"
connect_timeout: 5
listen: reboot_host

15
roles/base/tasks/main.yml Normal file
View File

@ -0,0 +1,15 @@
- name: Install useful software
apt:
name: ["vim", "wget"]
state: present
- name: Install network interfaces
template:
src: bridged-interface.cfg
dest: /etc/network/interfaces
notify: reboot_host
- name: Install bridge utilities
apt:
name: bridge-utils
state: present

View File

@ -0,0 +1,14 @@
# {{ ansible_managed }}
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto br1
iface br1 inet static
address {{ ip_addr }}
gateway {{ ip_gateway }}
bridge_ports {{ ip_inter }}
bridge_stp on
ethernet-wol g