Disable USB Wake service task

Closes #5
main
earnest ma 2022-01-30 19:45:21 -05:00
parent 85b5ab0d93
commit 23de12f7e9
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=Disable USB Mouse from waking
After=getty.target
[Service]
Type=oneshot
User=root
ExecStart=/usr/bin/bash -c "for i in $(cat /proc/acpi/wakeup| grep enabled | awk '{print $1}'| xargs); do echo $i | tee /proc/acpi/wakeup; done"
RemainAfterExit=true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,7 @@
---
- name: ensure_systemd_file_is_enabled
ansible.builtin.systemd:
name: disable_usb_wake.service
daemon_reload: yes
enabled: yes
state: restarted

View File

@ -0,0 +1,9 @@
---
- name: Copy disable usb wake service file
copy:
src: disable_usb_wake.service
dest: /etc/systemd/system/disable_usb_wake.service
owner: root
group: root
mode: 0644
notify: ensure_systemd_file_is_enabled

View File

@ -8,3 +8,7 @@
- include: packages.yml - include: packages.yml
- include: users.yml - include: users.yml
- include: nix.yml - include: nix.yml
- name: Disable wake on USB
import_tasks: disable_usb_wake.yml
when: disable_usb_wake == True