1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/2-common/tasks/iiab-startup.yml

28 lines
813 B
YAML

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