From bc39f8c42e60eb7fd6df5ec00a6f3ca35e238c4a Mon Sep 17 00:00:00 2001 From: James Tanner Date: Thu, 5 May 2016 10:41:06 -0400 Subject: [PATCH] Revert "remove checking of stderr for insserv (#1846)" This reverts commit 2ee6e4cf668a9bba77c3bb019d473f3614563838. --- lib/ansible/modules/system/service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/service.py b/lib/ansible/modules/system/service.py index ff5692c531..b0e39993a9 100644 --- a/lib/ansible/modules/system/service.py +++ b/lib/ansible/modules/system/service.py @@ -826,12 +826,12 @@ class LinuxService(Service): if self.enable: (rc, out, err) = self.execute_command("%s %s" % (self.enable_cmd, self.name)) - if (rc != 0): + if (rc != 0) or (err != ''): self.module.fail_json(msg=("Failed to install service. rc: %s, out: %s, err: %s" % (rc, out, err))) return (rc, out, err) else: (rc, out, err) = self.execute_command("%s -r %s" % (self.enable_cmd, self.name)) - if (rc != 0): + if (rc != 0) or (err != ''): self.module.fail_json(msg=("Failed to remove service. rc: %s, out: %s, err: %s" % (rc, out, err))) return (rc, out, err)