AZURE-211 determine the correct systemd service directory depending on the distribution

This commit is contained in:
dbacon
2020-08-26 10:02:38 +01:00
parent 67d4ed819c
commit 3bb04c45e6

View File

@@ -1,9 +1,16 @@
---
- name: "Set the systemd_dir"
set_fact:
systemd_dir: "{% if ansible_distribution|lower=='ubuntu' %}/lib/systemd/system{% else %}/usr/lib/systemd/system{% endif %}"
- name: "systemd_dir debug"
debug:
msg: "systemd_dir {{systemd_dir}}"
- name: "Install systemd service file"
template:
src: "product.service.j2"
dest: "/usr/lib/systemd/system/{{ atl_systemd_service_name }}"
dest: "{{systemd_dir}}/{{ atl_systemd_service_name }}"
owner: root
group: root
mode: 0640