Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1343585 - Bootstrap script assumes that host's domain is created prior to running bootstrap.py.
Summary: Bootstrap script assumes that host's domain is created prior to running boots...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Bootstrap
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Rich Jerrido
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks: 1394380
TreeView+ depends on / blocked
 
Reported: 2016-06-07 13:55 UTC by Lukas Pramuk
Modified: 2020-01-17 15:47 UTC (History)
8 users (show)

Fixed In Version: katello-client-bootstrap-1.2.0-4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1394380 (view as bug list)
Environment:
Last Closed: 2016-12-12 17:11:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Katello katello-client-bootstrap pull 85 0 'None' closed Add domain 2020-05-27 20:04:01 UTC
Red Hat Product Errata RHBA-2016:2940 0 normal SHIPPED_LIVE Satellite 6.2.5 Async Bug Release 2016-12-12 22:08:21 UTC

Description Lukas Pramuk 2016-06-07 13:55:01 UTC
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 14:14:20 UTC
There is a PR upstream to solve this: https://github.com/Katello/katello-client-bootstrap/pull/85

Comment 3 Rich Jerrido 2016-06-07 17:14:19 UTC
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 12:16:56 UTC
Upstream code is merged, moving to POST.

Comment 5 Lukas Pramuk 2016-12-05 14:27:11 UTC
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 17:11:39 UTC
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.