---

- block:
  - name: Install sync-accounts.py script
    copy:
      src: sync_accounts.py
      dest: /usr/local/bin/sync-accounts.py
      owner: root
      group: root
      mode: "0755"

  - name: Setup sync accounts in cron
    cron:
      name: slurm_sync_accounts
      cron_file: slurm_sync_accounts
      user: root
      job: "bash -c '/usr/local/bin/sync-accounts.py &>> /var/log/sync-accounts.log'"
      minute: 0
      state: present

  become: yes
