- name: Does /usr/libexec/iiab-startup.sh exist?
  stat:
    path: /usr/libexec/iiab-startup.sh
  register: startup_script

- name: If not, install /usr/libexec/iiab-startup.sh from template
  template:
    src: iiab-startup.sh
    dest: /usr/libexec/
    mode: 0755
  when: not startup_script.stat.exists

- name: Install {{ systemd_location }}/iiab-startup.service from template
  template:
    src: iiab-startup.service
    dest: "{{ systemd_location }}"
  when: not startup_script.stat.exists

- name: Enable & restart systemd service (iiab-startup) after daemon-reload
  # shell: systemctl daemon-reload
  # shell: systemctl restart iiab-startup.service
  # shell: systemctl enable iiab-startup.service
  systemd:
    name: iiab-startup
    daemon_reload: yes
    enabled: yes
    state: restarted
  when: not startup_script.stat.exists
