parent
85b5ab0d93
commit
23de12f7e9
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue