Skip to content

Commit

Permalink
Fix AD setup on RHEL 9. Use packages documentation calls for in the g…
Browse files Browse the repository at this point in the history
…iven version. (#16557)

(cherry picked from commit 3d194ed)
  • Loading branch information
lhellebr authored and web-flow committed Oct 4, 2024
1 parent afd4537 commit 9d3a1f4
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 @@ -2271,9 +2271,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 @@ -2362,16 +2367,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 9d3a1f4

Please sign in to comment.