-
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.
ci: Add a basic test for ad_integration_preserve_authselect_profile
- Loading branch information
1 parent
5063d7f
commit ee62490
Showing
1 changed file
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
- name: Ensure that the role ad_integration_preserve_authselect_profile works | ||
hosts: all,!ad | ||
gather_facts: false # test that role works in this case | ||
vars: | ||
# sample realm that will skip joining realm step | ||
ad_integration_realm: "{{ __ad_integration_sample_realm }}" | ||
ad_integration_password: Secret123 | ||
ad_integration_preserve_authselect_profile: true | ||
|
||
tasks: | ||
- name: Test - Run the system role | ||
include_role: | ||
name: linux-system-roles.ad_integration | ||
|
||
- name: Test - Check that realmd config is present | ||
stat: | ||
path: /etc/realmd.conf | ||
register: __stat_result | ||
failed_when: not __stat_result.stat.exists | ||
changed_when: false | ||
|
||
- name: Get realmd.conf | ||
slurp: | ||
path: /etc/realmd.conf | ||
register: realmd_conf_raw | ||
|
||
- name: Decode realmd.conf | ||
set_fact: | ||
realmd_conf: "{{ realmd_conf_raw.content | b64decode }}" | ||
|
||
- name: Test - Check that expected strings are in realmd.conf | ||
assert: | ||
that: | ||
- "'sssd-enable-logins = /usr/bin/sh' in realmd_conf" | ||
- "'sssd-disable-logins = /bin/true' in realmd_conf" |