diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml index ba79fe6..80d1879 100644 --- a/roles/ansible/tasks/main.yml +++ b/roles/ansible/tasks/main.yml @@ -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' diff --git a/roles/base/handlers/main.yml b/roles/base/handlers/main.yml new file mode 100644 index 0000000..1b3ed92 --- /dev/null +++ b/roles/base/handlers/main.yml @@ -0,0 +1,5 @@ +- name: Reboot host + reboot: + msg: "Reboot initiated by Ansible" + connect_timeout: 5 + listen: reboot_host diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml new file mode 100644 index 0000000..2b7c2e9 --- /dev/null +++ b/roles/base/tasks/main.yml @@ -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 diff --git a/roles/base/templates/bridged-interface.cfg b/roles/base/templates/bridged-interface.cfg new file mode 100644 index 0000000..dbd5fa3 --- /dev/null +++ b/roles/base/templates/bridged-interface.cfg @@ -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