Skip to content

Commit

Permalink
support amazon linux 2 for service module
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian McHugh committed Jan 29, 2018
1 parent 454ed23 commit 37e067c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions salt/modules/rh_service.py
Expand Up @@ -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))

Expand Down

0 comments on commit 37e067c

Please sign in to comment.