diff --git a/roles/linroom/files/99-wakeonlan.rules b/roles/linroom/files/99-wakeonlan.rules new file mode 100644 index 0000000..d4729ac --- /dev/null +++ b/roles/linroom/files/99-wakeonlan.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="net", NAME=="e*", RUN+="/usr/sbin/ethtool -s $name wol g" diff --git a/roles/linroom/tasks/fri_base.yml b/roles/linroom/tasks/fri_base.yml index 7e22a42..47c0f11 100644 --- a/roles/linroom/tasks/fri_base.yml +++ b/roles/linroom/tasks/fri_base.yml @@ -100,10 +100,8 @@ - name: Set time to local RTC shell: "timedatectl set-local-rtc 1 --adjust-system-clock" -- name: Fix WoL on Intel - template: - src: intel-wol.rules - dest: /etc/udev/rules.d/79-wol.rules +- name: Enable Wake-on-LAN + import_tasks: wake-on-lan.yml - name: Join AD shell: "realm join --user=ad.join@FRI1.UNI-LJ.SI --computer-ou=OU=Ucilnice FRI1.UNI-LJ.SI" diff --git a/roles/linroom/tasks/wake-on-lan.yml b/roles/linroom/tasks/wake-on-lan.yml new file mode 100644 index 0000000..c648b58 --- /dev/null +++ b/roles/linroom/tasks/wake-on-lan.yml @@ -0,0 +1,8 @@ +- name: Install ethtool + apt: + name: ethtool + +- name: Add udev rule to enable wake-on-lan for ethernet interfaces + copy: + dest: /etc/udev/rules.d/ + src: 99-wakeonlan.rules diff --git a/roles/linroom/templates/intel-wol.rules b/roles/linroom/templates/intel-wol.rules deleted file mode 100644 index 8baa58e..0000000 --- a/roles/linroom/templates/intel-wol.rules +++ /dev/null @@ -1 +0,0 @@ -ACTION=="add", SUBSYSTEM=="net", NAME=="e*", RUN+="/sbin/ethtool -s $name wol g"