Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1343585 - Bootstrap script assumes that host's domain is created prior to running bootstrap.py.
Bootstrap script assumes that host's domain is created prior to running boots...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Bootstrap (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity high (vote)
: 6.2.5
: Unused
Assigned To: Rich Jerrido
Lukas Pramuk
: Triaged
Depends On:
Blocks: 1394380
  Show dependency treegraph
 
Reported: 2016-06-07 09:55 EDT by Lukas Pramuk
Modified: 2016-12-12 12:11 EST (History)
8 users (show)

See Also:
Fixed In Version: katello-client-bootstrap-1.2.0-4
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1394380 (view as bug list)
Environment:
Last Closed: 2016-12-12 12:11:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github Katello/katello-client-bootstrap/pull/85 None None None 2016-07-21 02:21 EDT
Red Hat Product Errata RHBA-2016:2940 normal SHIPPED_LIVE Satellite 6.2.5 Async Bug Release 2016-12-12 17:08:21 EST

  None (edit)
Description Lukas Pramuk 2016-06-07 09:55:01 EDT
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
Comment 1 Evgeni Golov 2016-06-07 10:14:20 EDT
There is a PR upstream to solve this: https://github.com/Katello/katello-client-bootstrap/pull/85
Comment 3 Rich Jerrido 2016-06-07 13:14:19 EDT
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.
Comment 4 Bryan Kearney 2016-08-19 08:16:56 EDT
Upstream code is merged, moving to POST.
Comment 5 Lukas Pramuk 2016-12-05 09:27:11 EST
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)
Comment 7 errata-xmlrpc 2016-12-12 12:11:39 EST
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

Note You need to log in before you can comment on or make changes to this bug.