Skip to content

Commit

Permalink
[6.16.z] Fix AD setup on RHEL 9. Use packages documentation calls for…
Browse files Browse the repository at this point in the history
… in the given version. (#16571)

Fix AD setup on RHEL 9. Use packages documentation calls for in the given version. (#16557)

(cherry picked from commit 3d194ed)

Co-authored-by: Lukáš Hellebrandt <lhellebr@redhat.com>
  • Loading branch information
Satellite-QE and lhellebr authored Oct 4, 2024
1 parent 121e083 commit 9c18c8f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,9 +2180,14 @@ def enroll_ad_and_configure_external_auth(self, ad_data):
:type ad_data: Callable
"""
ad_data = ad_data()
version_dependent = (
'ipa-python-compat'
if int(self.satellite.version.split('.')[1]) < 13
else 'oddjob oddjob-mkhomedir'
)
packages = (
'sssd adcli realmd ipa-python-compat krb5-workstation '
'samba-common-tools gssproxy nfs-utils ipa-client'
f'sssd adcli realmd krb5-workstation samba-common-tools '
f'gssproxy nfs-utils ipa-client {version_dependent}'
)
realm = ad_data.realm
workgroup = ad_data.workgroup
Expand Down Expand Up @@ -2271,16 +2276,11 @@ def enroll_ad_and_configure_external_auth(self, ad_data):
assert self.execute('systemctl restart gssproxy.service').status == 0
assert self.execute('systemctl enable gssproxy.service').status == 0

# restart the deamon and httpd services
httpd_service_content = (
'.include /lib/systemd/system/httpd.service\n[Service]' '\nEnvironment=GSS_USE_PROXY=1'
)
assert (
self.execute(
f'echo "{httpd_service_content}" > /etc/systemd/system/httpd.service'
).status
== 0
assert self.execute("mkdir -p /etc/systemd/system/httpd.service.d/").status == 0
assert self.execute(
"echo -e '[Service]\\nEnvironment=GSS_USE_PROXY=1' > /etc/systemd/system/httpd.service.d/gssproxy.conf"
)
# restart the deamon and httpd services
assert (
self.execute('systemctl daemon-reload && systemctl restart httpd.service').status == 0
)
Expand Down

0 comments on commit 9c18c8f

Please sign in to comment.