Fix laptop role
This commit is contained in:
parent
026e371cc3
commit
9fa9cb3eee
@ -26,8 +26,8 @@
|
||||
target: install
|
||||
|
||||
- name: "Enable service"
|
||||
ansible.builtin.systemd:
|
||||
become: yes
|
||||
ansible.builtin.systemd:
|
||||
name: asusctl
|
||||
state: started
|
||||
enabled: yes
|
@ -1,18 +1,11 @@
|
||||
- name: Check if laptop has option to limit battery
|
||||
stat:
|
||||
path: /sys/class/power_supply/BAT0/charge_control_end_threshold
|
||||
register: battery_limiter_available
|
||||
- name: Copy service to limit battery charge
|
||||
become: yes
|
||||
copy:
|
||||
src: lib/systemd/system/battery-charge-threshold.service
|
||||
dest: /lib/systemd/system/battery-charge-threshold.service
|
||||
|
||||
- when: battery_limiter_available.stat.exists
|
||||
block:
|
||||
- name: Copy service to limit battery charge
|
||||
become: yes
|
||||
copy:
|
||||
src: lib/systemd/system/battery-charge-threshold.service
|
||||
dest: /lib/systemd/system/battery-charge-threshold.service
|
||||
|
||||
- name: Enable battery limit service
|
||||
become: yes
|
||||
systemd:
|
||||
name: battery-charge-threshold
|
||||
enabled: yes
|
||||
- name: Enable battery limit service
|
||||
become: yes
|
||||
systemd:
|
||||
name: battery-charge-threshold
|
||||
enabled: yes
|
||||
|
@ -1,5 +1,10 @@
|
||||
- import_tasks: battery.yml
|
||||
- name: Check if it's laptop
|
||||
stat:
|
||||
path: /sys/class/power_supply/BAT0/charge_control_end_threshold
|
||||
register: battery_limiter_available
|
||||
|
||||
- import_tasks: asusctl.yml
|
||||
|
||||
- import_tasks: supergfxctl.yml
|
||||
- when: battery_limiter_available.stat.exists
|
||||
block:
|
||||
- import_tasks: battery.yml
|
||||
- import_tasks: asusctl.yml
|
||||
- import_tasks: supergfxctl.yml
|
||||
|
@ -26,8 +26,8 @@
|
||||
target: install
|
||||
|
||||
- name: "Enable service"
|
||||
ansible.builtin.systemd:
|
||||
become: yes
|
||||
ansible.builtin.systemd:
|
||||
name: asusctl
|
||||
state: started
|
||||
enabled: yes
|
Loading…
Reference in New Issue
Block a user