mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipaplatform: add opencloudos/tencentos support
Fixes:https://pagure.io/freeipa/issue/9501 Signed-off-by: zoedong <zoedong@tencent.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
e5a9e46138
commit
2c0fe1dd92
9
ipaplatform/opencloudos/__init__.py
Normal file
9
ipaplatform/opencloudos/__init__.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This module contains OpenCloudOS family-specific platform files.
|
||||||
|
"""
|
||||||
|
|
||||||
|
NAME = "opencloudos"
|
23
ipaplatform/opencloudos/constants.py
Normal file
23
ipaplatform/opencloudos/constants.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This OpenCloudOS family base platform module exports platform related constants.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Fallback to default path definitions
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat.constants import RedHatConstantsNamespace, User, Group
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ("constants", "User", "Group")
|
||||||
|
|
||||||
|
|
||||||
|
class OpenCloudOSConstantsNamespace(RedHatConstantsNamespace):
|
||||||
|
SECURE_NFS_VAR = None
|
||||||
|
NAMED_OPENSSL_ENGINE = "pkcs11"
|
||||||
|
|
||||||
|
|
||||||
|
constants = OpenCloudOSConstantsNamespace()
|
20
ipaplatform/opencloudos/paths.py
Normal file
20
ipaplatform/opencloudos/paths.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This OpenCloudOS family base platform module exports default filesystem paths
|
||||||
|
as common in OpenCloudOS family-based systems.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat.paths import RedHatPathNamespace
|
||||||
|
|
||||||
|
|
||||||
|
class OpenCloudOSPathNamespace(RedHatPathNamespace):
|
||||||
|
NAMED_CRYPTO_POLICY_FILE = "/etc/crypto-policies/back-ends/bind.config"
|
||||||
|
SYSCONFIG_NFS = "/etc/nfs.conf"
|
||||||
|
|
||||||
|
|
||||||
|
paths = OpenCloudOSPathNamespace()
|
51
ipaplatform/opencloudos/services.py
Normal file
51
ipaplatform/opencloudos/services.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Contains OpenCloudOS family-specific service class implementations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat import services as redhat_services
|
||||||
|
|
||||||
|
# Mappings from service names as FreeIPA code references to these services
|
||||||
|
# to their actual systemd service names
|
||||||
|
opencloudos_system_units = redhat_services.redhat_system_units.copy()
|
||||||
|
opencloudos_system_units["named"] = opencloudos_system_units["named-regular"]
|
||||||
|
opencloudos_system_units["named-conflict"] = \
|
||||||
|
opencloudos_system_units["named-pkcs11"]
|
||||||
|
|
||||||
|
|
||||||
|
# Service classes that implement OpenCloudOS family-specific behaviour
|
||||||
|
|
||||||
|
|
||||||
|
class OpenCloudOSService(redhat_services.RedHatService):
|
||||||
|
system_units = opencloudos_system_units
|
||||||
|
|
||||||
|
|
||||||
|
# Function that constructs proper OpenCloudOS family-specific server classes
|
||||||
|
# for services of specified name
|
||||||
|
|
||||||
|
|
||||||
|
def opencloudos_service_class_factory(name, api=None):
|
||||||
|
if name in ["named", "named-conflict"]:
|
||||||
|
return OpenCloudOSService(name, api)
|
||||||
|
return redhat_services.redhat_service_class_factory(name, api)
|
||||||
|
|
||||||
|
|
||||||
|
# Magicdict containing OpenCloudOSService instances.
|
||||||
|
|
||||||
|
|
||||||
|
class OpenCloudOSServices(redhat_services.RedHatServices):
|
||||||
|
def service_class_factory(self, name, api=None):
|
||||||
|
return opencloudos_service_class_factory(name, api)
|
||||||
|
|
||||||
|
|
||||||
|
# Objects below are expected to be exported by platform module
|
||||||
|
|
||||||
|
timedate_services = redhat_services.timedate_services
|
||||||
|
service = opencloudos_service_class_factory
|
||||||
|
knownservices = OpenCloudOSServices()
|
19
ipaplatform/opencloudos/tasks.py
Normal file
19
ipaplatform/opencloudos/tasks.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This module contains default OpenCloudOS family-specific implementations of
|
||||||
|
system tasks.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat.tasks import RedHatTaskNamespace
|
||||||
|
|
||||||
|
|
||||||
|
class OpenCloudOSTaskNamespace(RedHatTaskNamespace):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
tasks = OpenCloudOSTaskNamespace()
|
@ -41,7 +41,9 @@ if __name__ == '__main__':
|
|||||||
"ipaplatform.redhat",
|
"ipaplatform.redhat",
|
||||||
"ipaplatform.rhel",
|
"ipaplatform.rhel",
|
||||||
"ipaplatform.rhel_container",
|
"ipaplatform.rhel_container",
|
||||||
"ipaplatform.suse"
|
"ipaplatform.suse",
|
||||||
|
"ipaplatform.opencloudos",
|
||||||
|
"ipaplatform.tencentos"
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"cffi",
|
"cffi",
|
||||||
|
10
ipaplatform/tencentos/__init__.py
Normal file
10
ipaplatform/tencentos/__init__.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This module contains TencentOS specific platform files.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
NAME = "tencentos"
|
23
ipaplatform/tencentos/constants.py
Normal file
23
ipaplatform/tencentos/constants.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This TencentOS base platform module exports platform related constants.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Fallback to default path definitions
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat.constants import RedHatConstantsNamespace, User, Group
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ("constants", "User", "Group")
|
||||||
|
|
||||||
|
|
||||||
|
class TencentOSConstantsNamespace(RedHatConstantsNamespace):
|
||||||
|
SECURE_NFS_VAR = None
|
||||||
|
NAMED_OPENSSL_ENGINE = "pkcs11"
|
||||||
|
|
||||||
|
|
||||||
|
constants = TencentOSConstantsNamespace()
|
20
ipaplatform/tencentos/paths.py
Normal file
20
ipaplatform/tencentos/paths.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This TencentOS base platform module exports default filesystem paths
|
||||||
|
as common in TencentOS-based systems.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat.paths import RedHatPathNamespace
|
||||||
|
|
||||||
|
|
||||||
|
class TencentOSPathNamespace(RedHatPathNamespace):
|
||||||
|
NAMED_CRYPTO_POLICY_FILE = "/etc/crypto-policies/back-ends/bind.config"
|
||||||
|
SYSCONFIG_NFS = "/etc/nfs.conf"
|
||||||
|
|
||||||
|
|
||||||
|
paths = TencentOSPathNamespace()
|
51
ipaplatform/tencentos/services.py
Normal file
51
ipaplatform/tencentos/services.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Contains TencentOS specific service class implementations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat import services as redhat_services
|
||||||
|
|
||||||
|
# Mappings from service names as FreeIPA code references to these services
|
||||||
|
# to their actual systemd service names
|
||||||
|
tencentos_system_units = redhat_services.redhat_system_units.copy()
|
||||||
|
tencentos_system_units["named"] = tencentos_system_units["named-regular"]
|
||||||
|
tencentos_system_units["named-conflict"] = \
|
||||||
|
tencentos_system_units["named-pkcs11"]
|
||||||
|
|
||||||
|
|
||||||
|
# Service classes that implement TencentOS-specific behaviour
|
||||||
|
|
||||||
|
|
||||||
|
class TencentOSService(redhat_services.RedHatService):
|
||||||
|
system_units = tencentos_system_units
|
||||||
|
|
||||||
|
|
||||||
|
# Function that constructs proper TencentOS-specific server classes for
|
||||||
|
# services of specified name
|
||||||
|
|
||||||
|
|
||||||
|
def tencentos_service_class_factory(name, api=None):
|
||||||
|
if name in ["named", "named-conflict"]:
|
||||||
|
return TencentOSService(name, api)
|
||||||
|
return redhat_services.redhat_service_class_factory(name, api)
|
||||||
|
|
||||||
|
|
||||||
|
# Magicdict containing TencentOSService instances.
|
||||||
|
|
||||||
|
|
||||||
|
class TencentOSServices(redhat_services.RedHatServices):
|
||||||
|
def service_class_factory(self, name, api=None):
|
||||||
|
return tencentos_service_class_factory(name, api)
|
||||||
|
|
||||||
|
|
||||||
|
# Objects below are expected to be exported by platform module
|
||||||
|
|
||||||
|
timedate_services = redhat_services.timedate_services
|
||||||
|
service = tencentos_service_class_factory
|
||||||
|
knownservices = TencentOSServices()
|
18
ipaplatform/tencentos/tasks.py
Normal file
18
ipaplatform/tencentos/tasks.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||||
|
#
|
||||||
|
|
||||||
|
"""
|
||||||
|
This module contains default TencentOS-specific implementations of system tasks.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from ipaplatform.redhat.tasks import RedHatTaskNamespace
|
||||||
|
|
||||||
|
|
||||||
|
class TencentOSTaskNamespace(RedHatTaskNamespace):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
tasks = TencentOSTaskNamespace()
|
Loading…
Reference in New Issue
Block a user