From 38d8db473f6941165d5feac02f41b6298c86796b Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 28 Aug 2014 14:44:43 +0200 Subject: [PATCH] Make "enabled" code aware of --check mode. --- lib/ansible/modules/system/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/system/service.py b/lib/ansible/modules/system/service.py index 37ecac2ddb6..7739fc8b00b 100644 --- a/lib/ansible/modules/system/service.py +++ b/lib/ansible/modules/system/service.py @@ -1032,6 +1032,9 @@ class OpenBsdService(Service): if rc == 1: return + if self.module.check_mode: + self.module.exit_json(changed=True, msg="changing service enablement") + # XXX check rc ? rc, stdout, stderr = self.execute_command("%s %s" % (self.enable_cmd, action)) self.changed = True