---

- name: Deploy linstor-controller conf
  template: src=linstor.toml.j2 dest=/etc/linstor/linstor.toml mode=640
  notify: restart linstor-controller
  tags: drbd

- name: Deploy linstor-client configuration
  template: src=linstor-client.conf.j2 dest=/etc/linstor/linstor-client.conf
  tags: drbd

- name: Setup logrotate
  template: src=logrotate.j2 dest=/etc/logrotate.d/linstor-controller
  tags: drbd

- name: Remove old reactor conf
  file: path=/etc/drbd-reactor.d/linstor_db.toml state=absent
  notify: restart drbd-reactor
  tags: drbd

- when: linctl_ha
  name: Configure the drbd-reactor promoter
  template: src=drbd-reactor.toml.j2 dest=/etc/drbd-reactor.d/linstor-controller.toml
  notify: restart drbd-reactor
  tags: drbd

