---
- name: install rsync
  pacman: name=rsync state=present

- name: install syncarchive script
  copy: src=syncarchive dest=/usr/local/bin/syncarchive owner=root group=root mode=0755

- name: install syncarchive units
  copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
  with_items:
    - syncarchive.timer
    - syncarchive.service

- name: start and enable syncarchive units
  systemd:
    name: "{{ item }}"
    enabled: true
    state: started
    daemon_reload: true
  with_items:
    - syncarchive.timer
