---

- name: Start and enable services
  service: name={{ item }} state=started enabled=True
  loop:
    - seafile
    - seahub
  # Only start services when not upgrading, or upgrading from the same major version
  # On major version upgrades, we need to run upgrade scripts manually
  when: seafile_install_mode != 'upgrade' or (seafile_current_major_version is defined and seafile_current_major_version == seafile_new_major_version)
  tags: seafile

- name: Start and enable timers
  systemd: name={{ item }}.timer state=started enabled=True
  loop:
    - seafile-clean-db
    - seafile-gc
  tags: seafile

