From 3bb04c45e6cce9d78e23fd85abf8e5d9bc91e3ff Mon Sep 17 00:00:00 2001 From: dbacon Date: Wed, 26 Aug 2020 10:02:38 +0100 Subject: [PATCH] AZURE-211 determine the correct systemd service directory depending on the distribution --- roles/product_startup/tasks/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/roles/product_startup/tasks/main.yml b/roles/product_startup/tasks/main.yml index c604379..d65e9d3 100644 --- a/roles/product_startup/tasks/main.yml +++ b/roles/product_startup/tasks/main.yml @@ -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