diff --git a/inventory.yml b/inventory.yml index 3307e16..cc44353 100644 --- a/inventory.yml +++ b/inventory.yml @@ -76,6 +76,7 @@ all: server_admin: "admin+unicorn@netz39.de" platon.n39.eu: server_admin: "admin+platon@netz39.de" + mac: "b8:27:eb:8f:98:2f" radon.n39.eu: server_admin: "admin+radon@netz39.de" krypton.n39.eu: diff --git a/platon.yml b/platon.yml index 4d817f2..22d6f83 100644 --- a/platon.yml +++ b/platon.yml @@ -18,3 +18,13 @@ # Should come from ble-keeper-role # see https://github.com/netz39/ble-keykeeper-role/issues/4 - python3-pip + + + - name: Set MAC address for proper DHCP recognition + # Uses mac variable from inventory + ansible.builtin.template: + src: templates/network-interfaces-dhcp-mac.j2 + dest: /etc/network/interfaces.d/platon-mac + owner: root + group: root + mode: '0644' diff --git a/templates/network-interfaces-dhcp-mac.j2 b/templates/network-interfaces-dhcp-mac.j2 new file mode 100644 index 0000000..a254bfa --- /dev/null +++ b/templates/network-interfaces-dhcp-mac.j2 @@ -0,0 +1,6 @@ +# Set a specific MAC address to enable DHCP recognition +allow-hotplug eth0 +iface eth0 inet dhcp + hwaddress ether {{ mac }} + +# THIS FILE IS MANAGED VIA ANSIBLE!