Red Hat Bugzilla – Bug 1343585
Bootstrap script assumes that host's domain is created prior to running bootstrap.py.
Last modified: 2016-12-12 12:11:39 EST
Description of problem: Bootstrap script assumes that host is in the same domain as Satellite is. If it is not your case, then you have to pre-create host's domain in Satellite. Version-Release number of selected component (if applicable): @Sat6.2.0-Snap14 katello-client-bootstrap-1.1.0-1.el7sat.noarch How reproducible: always Steps to Reproduce: 1. # ./bootstrap.py -l admin -p changeme -s <SAT_FQDN> -o 'Default Organization' -L 'Default Location' -g 'My Hostgroup' -a My_Activation_Key Foreman Bootstrap Script This script is designed to register new systems or to migrate an existing system to a Foreman server with Katello [NOTIFICATION], [2016-06-06 08:47:27], [This system is not registered to RHN. Attempting to register via subscription-manager] [NOTIFICATION], [2016-06-06 08:47:27], [Retrieving Client CA Certificate RPMs] [RUNNING], [2016-06-06 08:47:27], [rpm -Uvh http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm] Retrieving http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm Preparing... ################################################## katello-ca-consumer-<SAT_FQD################################################## [SUCCESS], [2016-06-06 08:47:32], [rpm -Uvh http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm], completed successfully. [ERROR], [2016-06-06 08:47:33], EXITING: [0 element in array for search key 'name="<CLIENT_DOMAIN>"' in API '/api/v2/domains'. Please note that all searches are case-sensitive. Fatal error.] failed to execute properly. Actual results: Script expects a domain for host to be already present and a user has to guess that It doesn't care of domain associated with hostgroup, it insists on deriving domain from host fqdn on its own. Expected results: Such behavior should be either re-implemented or documented
There is a PR upstream to solve this: https://github.com/Katello/katello-client-bootstrap/pull/85
The current $SUBJECT of this BZ is a bit inaccurate. current bootstrap assumes the domain of the host that is being registered exists prior to invocation of the script. On a Satellite with a single domain, these are the same, but may not always be the case. Updating $SUBJECT appropriately.
Upstream code is merged, moving to POST.
VERIFIED. @satellite-6.2.5-1.0.el6sat.noarch katello-client-bootstrap-1.2.0-4.el6sat.noarch # ./bootstrap.py -l admin -p changeme -s <SAT_FQDN> -o 'Default Organization' -L 'Default Location' -g 'My Hostgroup' -a 'My AK' ... [NOTIFICATION], [2016-12-05 09:15:29], [Domain khw.example.com doesn't exist in Foreman, consider using the --add-domain option.] # ./bootstrap.py -l admin -p changeme -s <SAT_FQDN> -o 'Default Organization' -L 'Default Location' -g 'My Hostgroup' -a 'My AK' --add-domain ... [RUNNING], [2016-12-05 09:19:10], [Calling Foreman API to create domain khw.example.com associated with the org & location] [RUNNING], [2016-12-05 09:19:10], [Calling Foreman API to create a host entry associated with the group & org] [SUCCESS], [2016-12-05 09:19:10], [Successfully created host host.khw.example.com], completed successfully. ... >>> when a host has different domain than Satellite script offers to add '--add-domain' option >>> with '--add-domain' option host is created successfully (and its domain too)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:2940