Skip to content

Conversation

@MikeyTide
Copy link

@MikeyTide MikeyTide commented Nov 12, 2025

SUMMARY

This pull request adds a new module sssd_info that allows users to check SSSD domain status and retrieve domain information using D-Bus.

The module provides the following actions:

  • domain_status - Check if a specific domain is online
  • domain_list - List all configured SSSD domains
  • active_servers - Get active servers for a specific domain and server type (IPA/AD)
  • list_servers - List all servers for a specific domain and server type (IPA/AD)
ISSUE TYPE
  • New Module/Plugin Pull Request
COMPONENT NAME

sssd_info

ADDITIONAL INFORMATION

The module uses D-Bus to communicate with SSSD's infopipe interface, providing reliable and direct access to SSSD status information without relying on command-line tools.

Key features:

  • Supports both IPA and AD domains
  • Provides comprehensive error handling for D-Bus exceptions
  • Works in check mode
  • Returns structured data for easy use in playbooks

Example usage:

- name: Check if domain is online
  community.general.sssd_info:
    action: domain_status
    domain: example.com

- name: Get list of all domains
  community.general.sssd_info:
    action: domain_list

- name: Get active IPA servers
  community.general.sssd_info:
    action: active_servers
    domain: example.com
    server_type: IPA

@ansibullbot ansibullbot added module module new_contributor Help guide this first time contributor new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit labels Nov 12, 2025
@ansibullbot
Copy link
Collaborator

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/sssd_info.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'No module named 'dbus''
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.description: required key not provided @ data['attributes']['platform']['description']. Got None
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.support: required key not provided @ data['attributes']['platform']['support']. Got None

The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.13 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test pep8 [explain] failed with 18 errors:

plugins/modules/sssd_info.py:17:8: W291: trailing whitespace
plugins/modules/sssd_info.py:118:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:122:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:127:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:131:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:139:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:145:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:150:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:159:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:168:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:179:28: W291: trailing whitespace
plugins/modules/sssd_info.py:180:31: W291: trailing whitespace
plugins/modules/sssd_info.py:193:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:197:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:200:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:210:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:230:11: W292: no newline at end of file
tests/unit/plugins/modules/test_sssd_info.py:14:40: W292: no newline at end of file

The test ansible-test sanity --test pylint [explain] failed with 17 errors:

plugins/modules/sssd_info.py:118:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:122:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:127:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:131:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:139:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:145:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:150:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:159:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:168:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:172:16: use-maxsplit-arg: Use str(domain).rsplit('/', maxsplit=1)[-1] instead
plugins/modules/sssd_info.py:179:27: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:180:30: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:193:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:197:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:200:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:210:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:230:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.13 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test pep8 [explain] failed with 18 errors:

plugins/modules/sssd_info.py:17:8: W291: trailing whitespace
plugins/modules/sssd_info.py:118:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:122:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:127:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:131:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:139:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:145:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:150:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:159:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:168:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:179:28: W291: trailing whitespace
plugins/modules/sssd_info.py:180:31: W291: trailing whitespace
plugins/modules/sssd_info.py:193:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:197:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:200:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:210:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:230:11: W292: no newline at end of file
tests/unit/plugins/modules/test_sssd_info.py:14:40: W292: no newline at end of file

The test ansible-test sanity --test pylint [explain] failed with 1 error:

tests/unit/plugins/modules/test_sssd_info.py:14:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/sssd_info.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'No module named 'dbus''
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.description: required key not provided @ data['attributes']['platform']['description']. Got None
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.support: required key not provided @ data['attributes']['platform']['support']. Got None

The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.13 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.14 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test pep8 [explain] failed with 18 errors:

plugins/modules/sssd_info.py:17:8: W291: trailing whitespace
plugins/modules/sssd_info.py:118:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:122:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:127:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:131:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:139:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:145:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:150:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:159:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:168:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:179:28: W291: trailing whitespace
plugins/modules/sssd_info.py:180:31: W291: trailing whitespace
plugins/modules/sssd_info.py:193:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:197:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:200:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:210:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:230:11: W292: no newline at end of file
tests/unit/plugins/modules/test_sssd_info.py:14:40: W292: no newline at end of file

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/sssd_info.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, ''
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.description: required key not provided @ data['attributes']['platform']['description']. Got None
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.support: required key not provided @ data['attributes']['platform']['support']. Got None

The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.13 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.14 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:

plugins/modules/sssd_info.py:113:0: traceback: ModuleNotFoundError: No module named 'dbus'

The test ansible-test sanity --test pep8 [explain] failed with 18 errors:

plugins/modules/sssd_info.py:17:8: W291: trailing whitespace
plugins/modules/sssd_info.py:118:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:122:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:127:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:131:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:139:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:145:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:150:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:159:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:168:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:179:28: W291: trailing whitespace
plugins/modules/sssd_info.py:180:31: W291: trailing whitespace
plugins/modules/sssd_info.py:193:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:197:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:200:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:210:1: W293: blank line contains whitespace
plugins/modules/sssd_info.py:230:11: W292: no newline at end of file
tests/unit/plugins/modules/test_sssd_info.py:14:40: W292: no newline at end of file

The test ansible-test sanity --test pylint [explain] failed with 1 error:

tests/unit/plugins/modules/test_sssd_info.py:14:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test pylint [explain] failed with 17 errors:

plugins/modules/sssd_info.py:118:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:122:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:127:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:131:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:139:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:145:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:150:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:159:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:168:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:172:16: use-maxsplit-arg: Use str(domain).rsplit('/', maxsplit=1)[-1] instead
plugins/modules/sssd_info.py:179:27: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:180:30: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:193:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:197:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:200:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:210:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:230:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test pylint [explain] failed with 17 errors:

plugins/modules/sssd_info.py:118:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:122:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:127:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:131:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:139:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:145:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:150:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:159:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:168:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:172:16: use-maxsplit-arg: Use str(domain).rsplit('/', maxsplit=1)[-1] instead
plugins/modules/sssd_info.py:179:27: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:180:30: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:193:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:197:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:200:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:210:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:230:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test pylint [explain] failed with 1 error:

tests/unit/plugins/modules/test_sssd_info.py:14:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test pylint [explain] failed with 17 errors:

plugins/modules/sssd_info.py:118:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:122:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:127:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:131:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:139:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:145:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:150:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:159:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:168:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:172:16: use-maxsplit-arg: Use str(domain).rsplit('/', maxsplit=1)[-1] instead
plugins/modules/sssd_info.py:179:27: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:180:30: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:193:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:197:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:200:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:210:0: trailing-whitespace: Trailing whitespace
plugins/modules/sssd_info.py:230:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/sssd_info.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, ''
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.description: required key not provided @ data['attributes']['platform']['description']. Got None
plugins/modules/sssd_info.py:0:0: invalid-documentation: DOCUMENTATION.attributes.platform.support: required key not provided @ data['attributes']['platform']['support']. Got None

The test ansible-test sanity --test pylint [explain] failed with 1 error:

tests/unit/plugins/modules/test_sssd_info.py:14:0: missing-final-newline: Final newline missing

click here for bot help

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Nov 12, 2025
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-12 Automatically create a backport for the stable-12 branch labels Nov 12, 2025
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MikeyTide

Thanks for the contribution! I left some comments in there for you, and I strongly suggest you read more documentation as you proceed.

@@ -0,0 +1,230 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed as Python 2 is no longer supported

Comment on lines +7 to +8
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also changed with the end of support for Python 2

Suggested change
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from __future__ import annotations



from ansible.module_utils.basic import AnsibleModule
import dbus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to read the docs for contributing. A good place to start is: https://github.com/ansible-collections/community.general/blob/main/CONTRIBUTING.md


def _get_domain_path(self, domain):
"""Convert domain name to D-Bus path format"""
return "/org/freedesktop/sssd/infopipe/Domains/%s" % domain.replace('.', '_2e')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use f-strings

Suggested change
return "/org/freedesktop/sssd/infopipe/Domains/%s" % domain.replace('.', '_2e')
return f"/org/freedesktop/sssd/infopipe/Domains/{domain.replace('.', '_2e')}"

@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-12 Automatically create a backport for the stable-12 branch check-before-release PR will be looked at again shortly before release and merged if possible. module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor new_plugin New plugin plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests unit tests/unit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants