- name: Install arch-boxes-sync.sh script dependencies
  pacman: name=curl,jq,unzip state=present

- name: Install arch-boxes-sync.sh script
  copy: src=arch-boxes-sync.sh dest=/usr/local/bin/ owner=root group=root mode=0755

- name: Install arch-boxes-sync.{service,timer}
  copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
  loop:
    - arch-boxes-sync.service
    - arch-boxes-sync.timer
  notify:
    - Daemon reload

- name: Start and enable arch-boxes-sync.timer
  systemd: name=arch-boxes-sync.timer enabled=yes daemon_reload=yes state=started