Compare commits
2 Commits
026e371cc3
...
62dde7026c
Author | SHA1 | Date | |
---|---|---|---|
62dde7026c | |||
9fa9cb3eee |
@ -4,13 +4,17 @@
|
|||||||
ansible.builtin.package_facts:
|
ansible.builtin.package_facts:
|
||||||
manager: auto
|
manager: auto
|
||||||
|
|
||||||
|
- name: Print the package facts
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: ansible_facts.packages
|
||||||
|
|
||||||
- name: remove snap
|
- name: remove snap
|
||||||
community.general.snap:
|
community.general.snap:
|
||||||
name: firefox
|
name: firefox
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- 'firefox' in ansible_facts.packages
|
- "'firefox' in ansible_facts.packages"
|
||||||
- ansible_facts.packages['firefox'].version == "1:1snap1-0ubuntu2"
|
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
|
||||||
|
|
||||||
- name: remove apt snap wrapper version
|
- name: remove apt snap wrapper version
|
||||||
apt:
|
apt:
|
||||||
@ -18,8 +22,8 @@
|
|||||||
pkg:
|
pkg:
|
||||||
- firefox
|
- firefox
|
||||||
when:
|
when:
|
||||||
- 'firefox' in ansible_facts.packages
|
- "'firefox' in ansible_facts.packages"
|
||||||
- ansible_facts.packages['firefox'].version == "1:1snap1-0ubuntu2"
|
- ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2"
|
||||||
|
|
||||||
- name: add ppa
|
- name: add ppa
|
||||||
apt_repository:
|
apt_repository:
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
target: install
|
target: install
|
||||||
|
|
||||||
- name: "Enable service"
|
- name: "Enable service"
|
||||||
ansible.builtin.systemd:
|
|
||||||
become: yes
|
become: yes
|
||||||
|
ansible.builtin.systemd:
|
||||||
name: asusctl
|
name: asusctl
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
@ -1,18 +1,11 @@
|
|||||||
- name: Check if laptop has option to limit battery
|
- name: Copy service to limit battery charge
|
||||||
stat:
|
become: yes
|
||||||
path: /sys/class/power_supply/BAT0/charge_control_end_threshold
|
copy:
|
||||||
register: battery_limiter_available
|
src: lib/systemd/system/battery-charge-threshold.service
|
||||||
|
dest: /lib/systemd/system/battery-charge-threshold.service
|
||||||
|
|
||||||
- when: battery_limiter_available.stat.exists
|
- name: Enable battery limit service
|
||||||
block:
|
become: yes
|
||||||
- name: Copy service to limit battery charge
|
systemd:
|
||||||
become: yes
|
name: battery-charge-threshold
|
||||||
copy:
|
enabled: yes
|
||||||
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
|
|
||||||
|
@ -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
|
- when: battery_limiter_available.stat.exists
|
||||||
|
block:
|
||||||
- import_tasks: supergfxctl.yml
|
- import_tasks: battery.yml
|
||||||
|
- import_tasks: asusctl.yml
|
||||||
|
- import_tasks: supergfxctl.yml
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
target: install
|
target: install
|
||||||
|
|
||||||
- name: "Enable service"
|
- name: "Enable service"
|
||||||
ansible.builtin.systemd:
|
|
||||||
become: yes
|
become: yes
|
||||||
|
ansible.builtin.systemd:
|
||||||
name: asusctl
|
name: asusctl
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
Loading…
Reference in New Issue
Block a user