mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'alpine' of git://github.com/fabaff/ansible into devel
Conflicts: library/setup
This commit is contained in:
commit
3d8bb6c2e0
1 changed files with 10 additions and 3 deletions
|
@ -99,7 +99,8 @@ class Facts(object):
|
|||
OSDIST_DICT = { '/etc/redhat-release': 'RedHat',
|
||||
'/etc/vmware-release': 'VMwareESX',
|
||||
'/etc/openwrt_release': 'OpenWrt',
|
||||
'/etc/system-release': 'OtherLinux' }
|
||||
'/etc/system-release': 'OtherLinux',
|
||||
'/etc/alpine-release': 'Alpine' }
|
||||
SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1: 'disabled' }
|
||||
|
||||
# A list of dicts. If there is a platform with more than one
|
||||
|
@ -111,7 +112,9 @@ class Facts(object):
|
|||
{ 'path' : '/usr/bin/pacman', 'name' : 'pacman' },
|
||||
{ 'path' : '/bin/opkg', 'name' : 'opkg' },
|
||||
{ 'path' : '/opt/local/bin/pkgin', 'name' : 'pkgin' },
|
||||
{ 'path' : '/opt/local/bin/port', 'name' : 'macports' } ]
|
||||
{ 'path' : '/opt/local/bin/port', 'name' : 'macports' },
|
||||
{ 'path' : '/sbin/apk', 'name' : 'apk' },
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
self.facts = {}
|
||||
|
@ -165,7 +168,7 @@ class Facts(object):
|
|||
SLED = 'Suse', OpenSuSE = 'Suse', SuSE = 'Suse', Gentoo = 'Gentoo',
|
||||
Archlinux = 'Archlinux', Mandriva = 'Mandrake', Mandrake = 'Mandrake',
|
||||
Solaris = 'Solaris', Nexenta = 'Solaris', OmniOS = 'Solaris', OpenIndiana = 'Solaris',
|
||||
SmartOS = 'Solaris', AIX = 'AIX', MacOSX = 'Darwin'
|
||||
SmartOS = 'Solaris', AIX = 'AIX', Alpine = 'Alpine', MacOSX = 'Darwin'
|
||||
)
|
||||
|
||||
if self.facts['system'] == 'AIX':
|
||||
|
@ -210,6 +213,10 @@ class Facts(object):
|
|||
release = re.search('DISTRIB_CODENAME="(.*)"', data)
|
||||
if release:
|
||||
self.facts['distribution_release'] = release.groups()[0]
|
||||
elif name == 'Alpine':
|
||||
data = get_file_content(path)
|
||||
self.facts['distribution'] = 'Alpine'
|
||||
self.facts['distribution_version'] = data
|
||||
else:
|
||||
self.facts['distribution'] = name
|
||||
|
||||
|
|
Loading…
Reference in a new issue