From 8b9772565eca31db0c19c986aaa9397349718b02 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 5 Dec 2014 12:45:01 -0500 Subject: [PATCH] now actually adds usable name for systemd when service only has init script --- lib/ansible/modules/system/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/system/service.py b/lib/ansible/modules/system/service.py index 9aa672fc437..c72fdf1efd4 100644 --- a/lib/ansible/modules/system/service.py +++ b/lib/ansible/modules/system/service.py @@ -420,6 +420,7 @@ class LinuxService(Service): if not systemd_enabled: return False + originalname = name # default to .service if the unit type is not specified if name.find('.') > 0: unit_name, unit_type = name.rsplit('.', 1) @@ -446,6 +447,7 @@ class LinuxService(Service): # systemd also handles init scripts (and is enabled at this point) if initscript: + self.__systemd_unit = originalname return True return False