---
- name: Install hdparm
  pacman: name=hdparm state=present

- name: Check for TRIM support
  shell: "hdparm -I /dev/sda | grep TRIM"
  register: hdparm
  ignore_errors: True

- name: Enable and start weekly filesystem TRIM timer
  service: name=fstrim.timer enabled=yes state=started
  when: "hdparm.rc == 0"
