Skip to content

Commit

Permalink
Update acpid config so that updates don't break it
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontleon committed Jun 8, 2022
1 parent 404c204 commit 56b101b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,28 @@
append: yes
become: true

- name: Check for acpi powerconf
stat: path=/etc/acpi/events/powerconf
- name: Check for acpi powerconf.disabled~
stat: path=/etc/acpi/events/powerconf.disabled~
register: power_stat

- name: Disable powerbutton in acpid
command: mv /etc/acpi/events/powerconf /etc/acpi/events/powerconf.disabled~
- name: If we moved the file put it back
command: mv /etc/acpi/events/powerconf.disabled~ /etc/acpi/events/powerconf
become: true
when: power_stat.stat.exists

- name: Comment out powerconf
copy:
content: |
# ACPID config to power down machine if powerbutton is pressed, but only if
# no gnome-power-manager is running
#The following two lines were commented out by the pixelbook-fedora playbook
#event=button/power.*
#action=/etc/acpi/actions/power.sh
dest: /etc/acpi/events/powerconf
become: true

- name: Enable acpid
become: true
systemd:
Expand Down

0 comments on commit 56b101b

Please sign in to comment.