---
- name: Install TLP
  pacman:
    name:
      - x86_energy_perf_policy
      - ethtool
      - tlp
      - tlp-rdw
    state: present
  tags:
    - tlp

- name: Copy TLP configuration file
  copy: src=tlp.conf dest=/etc/default/tlp
  notify:
    - restart tlp
  tags:
    - tlp

- name: Mask systemd radio service
  command: systemctl mask systemd-rfkill.service
  tags:
    - tlp

- name: Mask systemd radio socket
  command: systemctl mask systemd-rfkill.socket
  tags:
    - tlp

- name: Enable TLP
  service: name=tlp.service enabled=yes
  tags:
    - tlp

- name: Enable TLP sleep
  service: name=tlp-sleep.service enabled=yes
  tags:
    - tlp
