-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add sssd_info module #11120
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
base: main
Are you sure you want to change the base?
add sssd_info module #11120
Conversation
|
The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test The test |
russoz
left a comment
There was a problem hiding this 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 -*- | |||
There was a problem hiding this comment.
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
| from __future__ import (absolute_import, division, print_function) | ||
| __metaclass__ = type |
There was a problem hiding this comment.
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
| from __future__ import (absolute_import, division, print_function) | |
| __metaclass__ = type | |
| from __future__ import annotations |
|
|
||
|
|
||
| from ansible.module_utils.basic import AnsibleModule | ||
| import dbus |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use f-strings
| return "/org/freedesktop/sssd/infopipe/Domains/%s" % domain.replace('.', '_2e') | |
| return f"/org/freedesktop/sssd/infopipe/Domains/{domain.replace('.', '_2e')}" |
SUMMARY
This pull request adds a new module
sssd_infothat 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 onlinedomain_list- List all configured SSSD domainsactive_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
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:
Example usage: