---

- name: Install packages
  package: name={{ lingw_packages }}
  tags: drbd

- name: Install linstor-gateway
  get_url:
    url: "{{ lingw_bin_url }}"
    dest: /usr/local/bin/linstor-gateway
    checksum: sha256:{{ lingw_bin_sha256 }}
    mode: 755
  notify: restart linstor-gateway
  when: lingw_install_mode != 'none'
  tags: drbd

- name: Install linstor-gateway service unit
  template: src=linstor-gateway.service.j2 dest=/etc/systemd/system/linstor-gateway.service
  notify: restart linstor-gateway
  register: lingw_unit
  tags: drbd

- name: Reload systemd
  systemd: daemon_reload=True
  when: lingw_unit.changed
  tags: drbd

