Imported Upstream version 4.8.10
This commit is contained in:
7
ipaplatform/fedora_container/__init__.py
Normal file
7
ipaplatform/fedora_container/__init__.py
Normal 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
ipaplatform/fedora_container/constants.py
Normal file
13
ipaplatform/fedora_container/constants.py
Normal 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()
|
||||
30
ipaplatform/fedora_container/paths.py
Normal file
30
ipaplatform/fedora_container/paths.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# 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
|
||||
HTTPD_PASSWD_FILE_FMT = data(FedoraPathNamespace.HTTPD_PASSWD_FILE_FMT)
|
||||
|
||||
|
||||
paths = FedoraContainerPathNamespace()
|
||||
27
ipaplatform/fedora_container/services.py
Normal file
27
ipaplatform/fedora_container/services.py
Normal 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()
|
||||
34
ipaplatform/fedora_container/tasks.py
Normal file
34
ipaplatform/fedora_container/tasks.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
"""Fedora container tasks
|
||||
"""
|
||||
import logging
|
||||
|
||||
from ipaplatform.fedora.tasks import FedoraTaskNamespace
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FedoraContainerTaskNamespace(FedoraTaskNamespace):
|
||||
def modify_nsswitch_pam_stack(
|
||||
self, sssd, mkhomedir, statestore, sudo=True
|
||||
):
|
||||
# freeipa-container images are preconfigured
|
||||
# authselect select sssd with-sudo --force
|
||||
logger.debug("Authselect is pre-configured in container images.")
|
||||
|
||||
def is_mkhomedir_supported(self):
|
||||
# authselect is not pre-configured with mkhomedir
|
||||
return False
|
||||
|
||||
def restore_auth_configuration(self, path):
|
||||
# backup is supported but restore is a no-op
|
||||
logger.debug("Authselect is pre-configured in container images.")
|
||||
|
||||
def migrate_auth_configuration(self, statestore):
|
||||
logger.debug("Authselect is pre-configured in container images.")
|
||||
|
||||
|
||||
tasks = FedoraContainerTaskNamespace()
|
||||
Reference in New Issue
Block a user