Add ipaplatform for Fedora and RHEL container

Container platforms for Fedora and RHEL simplify FreeIPA container
effort. Paths are based on patches from
https://github.com/freeipa/freeipa-container

Fixes: https://pagure.io/freeipa/issue/8401
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
This commit is contained in:
Christian Heimes
2020-07-30 11:38:25 +02:00
parent eec5c9d820
commit 02986ff42b
14 changed files with 183 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
#
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
#
"""
This module contains Fedora Container specific platform files.
"""
NAME = 'fedora_container'
+13
View File
@@ -0,0 +1,13 @@
#
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
#
"""Fedora container constants
"""
from ipaplatform.fedora.constants import FedoraConstantsNamespace
class FedoraContainerConstantsNamespace(FedoraConstantsNamespace):
pass
constants = FedoraContainerConstantsNamespace()
+29
View File
@@ -0,0 +1,29 @@
#
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
#
"""Fedora container paths
"""
import os
from ipaplatform.fedora.paths import FedoraPathNamespace
def data(path):
return os.path.join("/data", path[1:])
class FedoraContainerPathNamespace(FedoraPathNamespace):
KRB5_CONF = data(FedoraPathNamespace.KRB5_CONF)
KRB5_KEYTAB = data(FedoraPathNamespace.KRB5_KEYTAB)
NAMED_KEYTAB = data(FedoraPathNamespace.NAMED_KEYTAB)
NAMED_CUSTOM_CONF = data(FedoraPathNamespace.NAMED_CUSTOM_CONF)
NAMED_CUSTOM_OPTIONS_CONF = data(
FedoraPathNamespace.NAMED_CUSTOM_OPTIONS_CONF
)
NSSWITCH_CONF = data(FedoraPathNamespace.NSSWITCH_CONF)
PKI_CONFIGURATION = data(FedoraPathNamespace.PKI_CONFIGURATION)
SAMBA_DIR = data(FedoraPathNamespace.SAMBA_DIR)
HTTPD_IPA_WSGI_MODULES_CONF = None
paths = FedoraContainerPathNamespace()
+27
View File
@@ -0,0 +1,27 @@
#
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
#
"""Fedora container services
"""
from ipaplatform.fedora import services as fedora_services
fedora_container_system_units = fedora_services.fedora_system_units.copy()
class FedoraContainerService(fedora_services.FedoraService):
system_units = fedora_container_system_units
def fedora_container_service_class_factory(name, api=None):
return fedora_services.fedora_service_class_factory(name, api)
class FedoraContainerServices(fedora_services.FedoraServices):
def service_class_factory(self, name, api=None):
return fedora_container_service_class_factory(name, api)
timedate_services = fedora_services.timedate_services
service = fedora_container_service_class_factory
knownservices = FedoraContainerServices()
+13
View File
@@ -0,0 +1,13 @@
#
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
#
"""Fedora container tasks
"""
from ipaplatform.fedora.tasks import FedoraTaskNamespace
class FedoraContainerTaskNamespace(FedoraTaskNamespace):
pass
tasks = FedoraContainerTaskNamespace()