Description of problem: This RFE requests the creation of a script to assist a user of another Red Hat Systems Management Platform (Satellite 5.x, RHN Classic, RHSM, SAM) to easily migrate a system from that platform to Satellite 6.x. Currently, there are a number of very manual steps that a user must take to get a system deregistered from their existing platform and properly registered against Satellite 6. Satellite 5.x provided this capability as a base script that took a number of user provided variables, such as hostname (of the satellite), activation keys, etc. and make it quite trivial to get an existing (not provisioned via Satellite system) into Satellite.
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Handling migrations from RHN Classic, RHSM and SAM to Sat6 isn't within the scope of the Transition project. If we talk about a Sat5's equivalent of the bootstrap script, I think it's a regular Sat6 RFE.
This isn't a Transition Tooling need. This is a general Sat6 product need for anyone who has existing RHEL systems that were registered to Sat 6 and were not provisioned via Sat6. Changing from Transitions to Registration. Cliff
*** Bug 1178194 has been marked as a duplicate of this bug. ***
*** Bug 1220631 has been marked as a duplicate of this bug. ***
*** Bug 1250903 has been marked as a duplicate of this bug. ***
FailedQA. @Sat6.2.0-Beta-Snap9 katello-client-bootstrap-1.0.0-1.el7sat.noarch Found issues: 1) It says: "Must specify server, login, hostgroup, location, and organization options". But it apparently requires also activation-key, I'd like it to be listed too. # ./bootstrap.py -l admin -p <PASSWORD> -s <SAT_FQDN> -o Defult_Organization -L Default_Location -g My_Hostgroup Must specify server, login, hostgroup, location, and organization options. See usage: ... >>> I'd like activation-key option to be listed too. 2) If it cannot find an entity (e.g. hostgroup, location) it just tracebacks # ./bootstrap.py -l admin -p <PASSWORD> -s <SAT_FQDN> -o Defult_Organization -L Default_Location -g Mistyped_Hostgroup -a My_Activation_Key ... Traceback (most recent call last): File "./bootstrap.py", line 432, in <module> create_host() File "./bootstrap.py", line 358, in create_host myhgid = return_matching_id('hostgroups', 'title=%s' % options.hostgroup, False) File "./bootstrap.py", line 317, in return_matching_id print_error("%d element in array for search key %s in API %s. Fatal error." % result_len, search_key, api_name) TypeError: not enough arguments for format string >>> I'd like to see an error "No such hostgroup", "No such location" etc... instead of just traceback.
3) Some entities no longer have labels (locations, hostgroups) -g HOSTGROUP, --hostgroup=HOSTGROUP *Label* of the Hostgroup in Foreman that the host is to >>> not true, it's a Name (or Title) of that entity
Most important issue: 4) It cannot handle entities having space in name, like Default Organization, Default Location Traceback (most recent call last): File "./bootstrap.py", line 432, in <module> create_host() File "./bootstrap.py", line 360, in create_host myorgid = return_matching_id('organizations', 'name=%s' % options.org, False) File "./bootstrap.py", line 317, in return_matching_id print_error("%d element in array for search key %s in API %s. Fatal error." % result_len, search_key, api_name) TypeError: not enough arguments for format string Traceback (most recent call last): File "./bootstrap.py", line 432, in <module> create_host() File "./bootstrap.py", line 359, in create_host mylocid = return_matching_id('locations', 'title=%s' % options.location, False) File "./bootstrap.py", line 317, in return_matching_id print_error("%d element in array for search key %s in API %s. Fatal error." % result_len, search_key, api_name)
(In reply to Lukas Pramuk from comment #35) > 2) > If it cannot find an entity (e.g. hostgroup, location) it just tracebacks > # ./bootstrap.py -l admin -p <PASSWORD> -s <SAT_FQDN> -o Defult_Organization > -L Default_Location -g Mistyped_Hostgroup -a My_Activation_Key > ... > Traceback (most recent call last): > File "./bootstrap.py", line 432, in <module> > create_host() > File "./bootstrap.py", line 358, in create_host > myhgid = return_matching_id('hostgroups', 'title=%s' % > options.hostgroup, False) > File "./bootstrap.py", line 317, in return_matching_id > print_error("%d element in array for search key %s in API %s. Fatal > error." % result_len, search_key, api_name) > TypeError: not enough arguments for format string > > >>> I'd like to see an error "No such hostgroup", "No such location" etc... instead of just traceback. https://github.com/Katello/katello-client-bootstrap/issues/57 https://github.com/Katello/katello-client-bootstrap/pull/59 :)
(In reply to Lukas Pramuk from comment #37) > Most important issue: > > 4) It cannot handle entities having space in name, like Default > Organization, Default Location > https://github.com/Katello/katello-client-bootstrap/issues/54 https://github.com/Katello/katello-client-bootstrap/pull/60
Upstream bug assigned to mmccune
Upstream bug component is Client & Agent
The version shipped in Beta does not call "subscription-manager repos --enable=rhel-*-satellite-tools-*-rpms", thus failing to install katello-agent afterwards.
The latest fixes should be in. Please close out this bug as "The script has been delivered" and open any subsequent issues under new bugs.
1.1.0 release https://github.com/Katello/katello-packaging/pull/231
VERIFIED. @satellite-6.2.0-14.2.el7sat.noarch Bootstrap Script is installed with latest snap: # rpm -qf /var/www/html/pub/bootstrap.py katello-client-bootstrap-1.1.0-1.el7sat.noarch Issues to consider: 1) Script assumes that client is in the same domain as Satellite is. If it is not the case, then you have to pre-create client's domain in Satellite. ./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. 2) Either "rpm -Uvh" or "subscription-manager register" should use force, not inner one, but an option "--force" [ERROR], [2016-06-06 08:49:13], EXITING: [rpm -Uvh http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm] failed to execute properly. Retrieving http://<SAT_FQDN>/pub/katello-ca-consumer-latest.noarch.rpm Preparing... ################################################## package katello-ca-consumer-<SAT_FQDN>-1.0-1.noarch is already installed [ERROR], [2016-06-07 06:28:08], EXITING: [/usr/sbin/subscription-manager register --org 'Default_Organization' --name '<CLIENT_FQDN>' --activationkey 'My Activation Key' --serverurl=https://<SAT_FQDN>:443/rhsm --baseurl=https://<SAT_FQDN>/pulp/repos] failed to execute properly. This system is already registered. Use --force to override 3) Quite often you end up with Error 422 (Un-processable entity) related to a Hostgroup used. The Hostgroup needs to be setup properly, otherwise you get various errors: "Ip can't be blank" => missing subnet configuration "Environment can't be blank" => missing Puppet Environment configuration "Subnet is not defined for host's location." (luckily this one is more self-explanatory)
BZ 1343546 - Bootstrap script should run commands with --force
BZ 1343585 - Bootstrap script assumes that host is in the same domain as Satellite is
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:1501