2017-11-24 16:57:46 +00:00
|
|
|
- name: Does systemd startup service exist
|
|
|
|
stat: path="{{ systemd_location }}/iiab-startup.service"
|
|
|
|
register: startup_unit
|
|
|
|
|
|
|
|
- name: Copy startup service to /etc/systemd/system
|
|
|
|
template: src=iiab-startup.service
|
|
|
|
dest=/etc/systemd/system/
|
|
|
|
when: startup_unit.stat.exists is defined and not startup_unit.stat.exists
|
|
|
|
|
|
|
|
- name: Copy startup script
|
|
|
|
template: src=iiab-startup.sh
|
|
|
|
dest=/usr/libexec/
|
2017-11-25 01:25:55 +00:00
|
|
|
mode=0755
|
2017-11-24 16:57:46 +00:00
|
|
|
when: startup_unit.stat.exists is defined and not startup_unit.stat.exists
|
|
|
|
|
|
|
|
- name: Ask systemd to recognize the changes
|
|
|
|
shell: systemctl daemon-reload
|
|
|
|
when: startup_unit.stat.exists is defined and not startup_unit.stat.exists
|
|
|
|
|
|
|
|
- name: Restart so systemd recognizes the changes
|
|
|
|
shell: systemctl restart iiab-startup.service
|
|
|
|
when: startup_unit.stat.exists is defined and not startup_unit.stat.exists
|
|
|
|
|
|
|
|
- name: Enable the reload service
|
|
|
|
shell: systemctl enable iiab-startup.service
|
|
|
|
when: startup_unit.stat.exists is defined and not startup_unit.stat.exists
|