Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sssdutils: adding with-mkhomedir common configuration #125

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion sssd_test_framework/utils/sssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def async_start(

:param service: Service to start, defaults to 'sssd'
:type service: str, optional
:param service_user: User used to start the service, defaults to 'sssd'
:type service_user: str, optional
:param apply_config: Apply current configuration, defaults to True
:type apply_config: bool, optional
:param check_config: Check configuration for typos, defaults to True
Expand Down Expand Up @@ -160,6 +162,8 @@ def start(

:param service: Service to start, defaults to 'sssd'
:type service: str, optional
:param service_user: User used to start the service, defaults to 'sssd'
:type service_user: str, optional
:param raise_on_error: Raise exception on error, defaults to True
:type raise_on_error: bool, optional
:param apply_config: Apply current configuration, defaults to True
Expand Down Expand Up @@ -448,7 +452,7 @@ def genconf(self, section: str | None = None) -> ProcessResult:
Exec ``sssd --genconf`` or ``sssd --genconf-section=section`` if ``section`` is not ``None``.

:param section: Section that will be refreshed. Defaults to ``None``.
:type path: str | None, optional
:type section: str | None, optional
:return: Result of the ran command.
:rtype: ProcessResult
"""
Expand Down Expand Up @@ -871,6 +875,21 @@ def autofs(self) -> None:
self.sssd.authselect.select("sssd")
self.sssd.enable_responder("autofs")

def mkhomedir(self, homedir: str = "/home") -> None:
"""
Configure SSSD with mkhomedir and oddjobd.

:param homedir: Home directory path.
:type homedir: str | None, optional

#. Select authselect sssd profile with 'with-mkhomedir'
#. Start oddjobd.service
#. Backup home directory
"""
self.sssd.authselect.select("sssd", ["with-mkhomedir"])
self.sssd.svc.start("oddjobd.service")
self.sssd.fs.backup(homedir)

def proxy(
self,
proxy: Literal["files", "ldap"] = "files",
Expand Down
Loading