ansible-desktop/roles/laptop/tasks/powersave.yml

40 lines
825 B
YAML
Raw Normal View History

2023-08-26 21:57:26 +00:00
- name: install required packages for script [Ubuntu]
2022-10-25 23:18:13 +00:00
become: yes
apt:
update_cache: yes
pkg:
- linux-tools-common
- linux-tools-generic
2023-08-26 21:57:26 +00:00
when: ansible_distribution == "Ubuntu"
- name: install required packages for script [Arch]
become: yes
community.general.pacman:
name:
- cpupower
when: ansible_distribution == "Archlinux"
2022-10-25 23:18:13 +00:00
- name: copy scripts
become: yes
copy:
src: "usr/local/sbin/{{item}}"
dest: "/usr/local/sbin/{{item}}"
mode: '0755'
loop:
- power-saver-mode
- unlimited-power
- name: add udev rules
become: yes
copy:
src: etc/udev/rules.d/99-powersave.rules
dest: /etc/udev/rules.d/99-powersave.rules
mode: '0755'
2022-10-25 23:25:32 +00:00
- name: 'reload udev rules'
become: yes
shell:
cmd: |
udevadm control --reload
udevadm trigger