mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add more error detail to the service module for FreeBSD
This commit is contained in:
parent
aafe7f5b37
commit
6008ea40ee
1 changed files with 4 additions and 2 deletions
|
@ -790,9 +790,11 @@ class FreeBsdService(Service):
|
|||
self.rcconf_file = rcfile
|
||||
|
||||
rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.svc_cmd, self.name, 'rcvar', self.arguments))
|
||||
cmd = "%s %s %s %s" % (self.svc_cmd, self.name, 'rcvar', self.arguments)
|
||||
rcvars = shlex.split(stdout, comments=True)
|
||||
|
||||
if not rcvars:
|
||||
self.module.fail_json(msg="unable to determine rcvar")
|
||||
self.module.fail_json(msg="unable to determine rcvar", stdout=stdout, stderr=stderr)
|
||||
|
||||
# In rare cases, i.e. sendmail, rcvar can return several key=value pairs
|
||||
# Usually there is just one, however. In other rare cases, i.e. uwsgi,
|
||||
|
@ -805,7 +807,7 @@ class FreeBsdService(Service):
|
|||
break
|
||||
|
||||
if self.rcconf_key is None:
|
||||
self.module.fail_json(msg="unable to determine rcvar")
|
||||
self.module.fail_json(msg="unable to determine rcvar", stdout=stdout, stderr=stderr)
|
||||
|
||||
return self.service_enable_rcconf()
|
||||
|
||||
|
|
Loading…
Reference in a new issue