---
- name: tlp | Install tlp package
  community.general.apk:
    name: tlp
    state: present

# I have a ThinkPad laptop :)
- name: tlp | Install acpi_call kernel module
  community.general.apk:
    name: acpi_call-src
    state: present
  when: ansible_hostname == 'alpine-tp'

- name: tlp | Copy configuration
  template:
    src: tlp/00-custom.j2
    dest: /etc/tlp.d/00-custom.conf
    owner: root
    group: root
    mode: '644'

- name: tlp | Add tlp service to runlevel 'default'
  service:
    name: tlp
    enabled: true
    state: started
    runlevel: default
