-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add SSSD parameters support (#76)
Enhancement: Add variable for setting configuration variable inside the [sssd] section of the sssd.conf file Reason: In my use case, I need to set some additional option like `default_domain_suffix` to be present inside the [sssd] section. This role doesn't have a variable for doing that. You can only set inside `[domain/YOURDOMAIN]` Result: You can use the variable `ad_integration_sssd_settings` to set some extra paremters like documented in https://linux.die.net/man/5/sssd.conf Issue Tracker Tickets (Jira or BZ if any): N/A P.S : It's my first PR. Be kind with me 😉 --------- Signed-off-by: Rich Megginson <[email protected]> Signed-off-by: Girard Sebastien <[email protected]> Signed-off-by: Sebastien Girard <[email protected]> Co-authored-by: Rich Megginson <[email protected]>
- Loading branch information
Showing
6 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,6 +204,18 @@ Useful if some specific configuration like --user-principal=host/name@REALM or - | |
See man realm for details. | ||
Example: ad_integration_join_parameters: "--user-principal host/client0[email protected]" | ||
|
||
#### ad_integration_sssd_settings | ||
|
||
A list of setting to be included into the `[sssd]` section | ||
of the sssd.conf file. See sssd.conf man pages for details. | ||
Example: | ||
|
||
```yaml | ||
ad_integration_sssd_settings: | ||
- key: "configuration_name" | ||
value: "configuration_value" | ||
``` | ||
#### ad_integration_sssd_custom_settings | ||
A list of custom setting to be included into the `[domain/$REALM]` section | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
|
||
- name: Ensure that the role configures dynamic dns | ||
hosts: all,!ad | ||
gather_facts: false # test that role works in this case | ||
vars: | ||
ad_integration_realm: sample-realm.com | ||
__ad_integration_test_sssd_config_only: true | ||
ad_integration_sssd_settings: | ||
- key: reconnection_retries | ||
value: 5 | ||
- key: default_domain_suffix | ||
value: addomain.xyz | ||
|
||
tasks: | ||
- name: Test - Run the system role with bogus vars | ||
include_role: | ||
name: linux-system-roles.ad_integration | ||
|
||
- name: Check SSSD settings | ||
community.general.ini_file: | ||
path: /etc/sssd/sssd.conf | ||
state: "{{ item.state | default('present') }}" | ||
section: sssd | ||
option: "{{ item.key }}" | ||
value: "{{ item.value }}" | ||
create: true | ||
owner: root | ||
group: root | ||
mode: u=rw,g=,o= | ||
loop: "{{ ad_integration_sssd_settings }}" | ||
register: __result | ||
failed_when: __result is changed | ||
|
||
- name: Search /var/log/sssd/sssd.log for [sss_ini_call_validators] | ||
command: >- | ||
grep -i sss_ini_call_validators /var/log/sssd/sssd.log | ||
register: sssd_log | ||
changed_when: false | ||
failed_when: false | ||
|
||
- name: Fail if signature found | ||
fail: | ||
msg: Appears to be an unsupported option in /etc/sssd/sssd.conf | ||
when: sssd_log.stdout | length > 0 | ||
|
||
- name: Test - Re-Build a list of settings with state=absent | ||
set_fact: | ||
update_list: "{{ ad_integration_sssd_settings | | ||
map('combine', {'state': 'absent'}) | list }}" | ||
|
||
- name: Test - Re-run the system role to remove vars | ||
include_role: | ||
name: linux-system-roles.ad_integration | ||
vars: | ||
ad_integration_sssd_settings: "{{ update_list }}" | ||
|
||
- name: Check custom SSSD settings | ||
community.general.ini_file: | ||
path: /etc/sssd/sssd.conf | ||
state: "{{ item.state | default('present') }}" | ||
section: sssd | ||
option: "{{ item.key }}" | ||
value: "{{ item.value }}" | ||
create: true | ||
owner: root | ||
group: root | ||
mode: u=rw,g=,o= | ||
loop: "{{ update_list }}" | ||
register: __result | ||
failed_when: __result is changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters