Manage interfaces and update dependency check
Setup bridge networking, install useful packages and fix Ansible dependency check.
This commit is contained in:
parent
8e546cc720
commit
e425808b02
@ -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'
|
||||
|
5
roles/base/handlers/main.yml
Normal file
5
roles/base/handlers/main.yml
Normal 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
15
roles/base/tasks/main.yml
Normal 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
|
14
roles/base/templates/bridged-interface.cfg
Normal file
14
roles/base/templates/bridged-interface.cfg
Normal 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
|
Loading…
Reference in New Issue
Block a user