Use variables in the TLP configuration.
This commit is contained in:
@@ -3,24 +3,36 @@
|
||||
# Attempt to save battery life by having a daemon tune the CPU and disable
|
||||
# unneeded components like USB, Bluetooth, WiFi, etc when not in use.
|
||||
|
||||
## Variables ##
|
||||
|
||||
- name: Workstation | Linux | Software | TLP | Facts
|
||||
set_fact:
|
||||
tlp: "tlp"
|
||||
tlp_rdw: "tlp-rdw"
|
||||
tlp_smart: "smartmontools"
|
||||
tlp_config: "/etc/tlp.conf"
|
||||
tlp_service: "tlp"
|
||||
ppd_package: "power-profiles-daemon"
|
||||
ppd_service: "power-profiles-daemon"
|
||||
|
||||
## Conflicts ##
|
||||
|
||||
- name: Workstation | Linux | Software | TLP | Conflicts | Disable
|
||||
service:
|
||||
name: power-profiles-daemon
|
||||
name: "{{ ppd_package }}"
|
||||
state: stopped
|
||||
enabled: false
|
||||
|
||||
- name: Workstation | Linux | Software | TLP | Conflicts | Remove
|
||||
package:
|
||||
name: power-profiles-daemon
|
||||
name: "{{ ppd_service }}"
|
||||
state: absent
|
||||
|
||||
## Install TLP + Associated Software ##
|
||||
|
||||
- name: Workstation | Linux | Software | TLP | Install
|
||||
package:
|
||||
name: tlp tlp-rdw smartmontools
|
||||
name: "{{ tlp }} {{ tlp_rdw }} {{ tlp_smart }}"
|
||||
update_cache: yes
|
||||
|
||||
## Configuration ##
|
||||
@@ -60,6 +72,6 @@
|
||||
|
||||
- name: Workstation | Linux | Software | TLP | Enable + Start
|
||||
service:
|
||||
name: tlp
|
||||
name: "{{ tlp_service }}"
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user