diff --git a/lib/ansible/modules/system/service.py b/lib/ansible/modules/system/service.py index 46cd3dba569..fdcc4d39b9e 100644 --- a/lib/ansible/modules/system/service.py +++ b/lib/ansible/modules/system/service.py @@ -106,7 +106,8 @@ import select import time import string -from distutils.version import LooseVersion +if platform.system() == 'Linux': + from distutils.version import LooseVersion class Service(object): """