support amazon linux 2 for service module

This commit is contained in:
Christian McHugh 2018-01-29 20:13:55 +00:00
parent 454ed23f62
commit 37e067c7b5

View File

@ -97,6 +97,15 @@ def __virtual__():
'RedHat-based distros >= version 7 use systemd, will not '
'load rh_service.py as virtual \'service\''
)
if __grains__['os'] == 'Amazon':
if int(osrelease_major) in (2016, 2017):
return __virtualname__
else:
return (
False,
'Amazon Linux >= version 2 use systemd, will not '
'load rh_service.py as virtual \'service\''
)
return __virtualname__
return (False, 'Cannot load rh_service module: OS not in {0}'.format(enable))