From 5894254e71c909850e96c872b61ca6a9db85e0ac Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 23 Jan 2021 23:18:18 +0100 Subject: add wakeonlan role --- .../wakeonlan/templates/wakeonlan.service.j2 | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 roles/network/wakeonlan/templates/wakeonlan.service.j2 (limited to 'roles/network/wakeonlan/templates') diff --git a/roles/network/wakeonlan/templates/wakeonlan.service.j2 b/roles/network/wakeonlan/templates/wakeonlan.service.j2 new file mode 100644 index 00000000..c163e8a7 --- /dev/null +++ b/roles/network/wakeonlan/templates/wakeonlan.service.j2 @@ -0,0 +1,25 @@ +[Unit] +Description=Configure Wake-on-LAN + +[Service] +Type=oneshot +{% for interface in wakeonlan_interfaces %} +ExecStart=/usr/sbin/ethtool -s {{ interface }} wol {{ wakeonlan_options | join }} +{% endfor %} +{% for interface in wakeonlan_interfaces %} +ExecStop=/usr/sbin/ethtool -s {{ interface }} wol d +{% endfor %} +RemainAfterExit=yes +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=strict +ProtectHome=yes +ProtectKernelTunables=yes +ProtectControlGroups=yes +RestrictRealtime=yes +RestrictAddressFamilies=AF_UNIX AF_NETLINK +SystemCallArchitectures=native + +[Install] +WantedBy=basic.target -- cgit v1.2.3