Skip to content

Commit

Permalink
ipa-replica-install --setup-adtrust: check for package ipa-server-tru…
Browse files Browse the repository at this point in the history
…st-ad

When adding the option --setup-adtrust to ipa-replica-install,
we need to check that the package freeipa-server-trust-ad is
installed.
To avoid relying on OS-specific commands like yum, the check is instead
ensuring that the file /usr/share/ipa/smb.conf.empty is present
(this file is delivered by the package).
When the check is unsuccessful, ipa-replica-install exits with an error
message.

Fixes: https://pagure.io/freeipa/issue/7602
  • Loading branch information
flo-renaud committed Oct 23, 2018
1 parent 2fba5ac commit 2986286
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions ipaplatform/base/constants.py
Expand Up @@ -15,6 +15,7 @@ class BaseConstantsNamespace:
HTTPD_USER = "apache"
HTTPD_GROUP = "apache"
GSSPROXY_USER = "root"
IPA_ADTRUST_PACKAGE_NAME = "freeipa-server-trust-ad"
IPA_DNS_PACKAGE_NAME = "freeipa-server-dns"
KDCPROXY_USER = "kdcproxy"
NAMED_USER = "named"
Expand Down
1 change: 1 addition & 0 deletions ipaplatform/rhel/constants.py
Expand Up @@ -13,6 +13,7 @@


class RHELConstantsNamespace(RedHatConstantsNamespace):
IPA_ADTRUST_PACKAGE_NAME = "ipa-server-trust-ad"
IPA_DNS_PACKAGE_NAME = "ipa-server-dns"

constants = RHELConstantsNamespace()
9 changes: 9 additions & 0 deletions ipaserver/install/adtrustinstance.py
Expand Up @@ -72,6 +72,15 @@ def check_inst():
"start the installation again")
return False

# Check that ipa-server-trust-ad package is installed,
# by looking for the file /usr/share/ipa/smb.conf.empty
if not os.path.exists(os.path.join(paths.USR_SHARE_IPA_DIR,
"smb.conf.empty")):
print("AD Trust requires the '%s' package" %
constants.IPA_ADTRUST_PACKAGE_NAME)
print("Please install the package and start the installation again")
return False

#TODO: Add check for needed samba4 libraries

return True
Expand Down

0 comments on commit 2986286

Please sign in to comment.