- name: Does /usr/libexec/iiab-startup.sh exist? stat: path: /usr/libexec/iiab-startup.sh register: startup_script - name: Copy template script to /usr/libexec/iiab-startup.sh template: src: iiab-startup.sh dest: /usr/libexec/ mode: 0755 when: not startup_script.stat.exists - name: Copy iiab-startup.service to {{ systemd_location }} template: src: iiab-startup.service dest: "{{ systemd_location }}" when: not startup_script.stat.exists - name: Enable & restart the systemd service 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