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 2084106 - satellite-change-hostname on capsule runs deprecated capsule-installer
Summary: satellite-change-hostname on capsule runs deprecated capsule-installer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: satellite-change-hostname
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.11.0
Assignee: Evgeni Golov
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-11 12:24 UTC by Lukas Pramuk
Modified: 2022-07-05 14:35 UTC (History)
2 users (show)

Fixed In Version: katello-4.3.0-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2085082 (view as bug list)
Environment:
Last Closed: 2022-07-05 14:35:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34896 0 Normal Ready For Testing satellite-change-hostname on capsule runs deprecated capsule-installer 2022-05-12 14:07:43 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:35:58 UTC

Description Lukas Pramuk 2022-05-11 12:24:21 UTC
Description of problem:
satellite-change-hostname on capsule runs deprecated capsule-installer

Version-Release number of selected component (if applicable):
6.11.0 Snap19
satellite-common-6.11.0-0.11.beta.el7sat.noarch
katello-common-4.3.0-1.el7sat.noarch

How reproducible:
deterministic

Steps to Reproduce:
1.Run satellite-change-hostname on capsule

# satellite-change-hostname new-sat.example.com -u admin -p changeme -c /root/new-sat.example.com-certs.tar -y
Checking for certs tarball

Checking hostname validity
updating hostname in /etc/hostname
setting hostname
checking if hostname was changed
stopping services
removing old cert rpms
No Match for argument: sat.example.com-apache*
No Match for argument: sat.example.com-foreman-client*
No Match for argument: sat.example.com-foreman-proxy*
No Match for argument: sat.example.com-foreman-proxy-client*
No Match for argument: sat.example.com-puppet-client*
No Match for argument: sat.example.com-qpid-broker*
No Match for argument: sat.example.com-qpid-client-cert*
No Match for argument: sat.example.com-qpid-router-client*
No Match for argument: sat.example.com-qpid-router-server*
No Match for argument: sat.example.com-tomcat*
deleting old certs
backed up /var/www/html/pub to /var/www/html/pub/sat.example.com-20220511061913.backup
updating hostname in /etc/hosts
updating hostname in foreman installer scenarios
backing up last_scenario.yaml
removing last_scenario.yaml
re-running the installer
capsule-installer --scenario capsule -v --disable-system-checks --foreman-proxy-register-in-foreman false --certs-tar-file /root/new-sat.example.com-certs.tar
restoring last_scenario.yaml
cleaning up temporary files
ERROR: capsule-installer is no longer used.  Please use 'satellite-installer --scenario capsule'.
       For more information on available options, include '--help'.

  Something went wrong with the Capsule installer.
  Please check the above output and the corresponding logs.
  
  Once the issue is resolved you may complete the hostname change by running: 'capsule-installer --scenario capsule -v --disable-system-checks'
  and completing the following steps:
You will have to update the Name and URL of the Smart Proxy in Capsule to the new hostname.



Failed 'capsule-installer --scenario capsule -v --disable-system-checks --foreman-proxy-register-in-foreman false --certs-tar-file /root/new-sat.example.com-certs.tar' with exit code 1

Actual results:
tool doesn't work on capsule (capsule-installer was on 6.1)

Expected results:
tool works on capsule successfully

Additional info:
/usr/sbin/katello-change-hostname:15: proxy_hyphenated: "foreman-proxy-content",
/usr/sbin/satellite-change-hostname:15: proxy_hyphenated: "capsule",

/usr/share/katello/hostname-change.rb:36:
    def get_default_program
      case @last_scenario
      when "katello"
        return "foreman"
      when @proxy_hyphenated
        return "foreman"           <- this is expected 
      else
        return @last_scenario      <- this is actual result
      end
    end

# ll /etc/foreman-installer/scenarios.d/last_scenario.yaml
lrwxrwxrwx. 1 root root 47 May 11 08:02 /etc/foreman-installer/scenarios.d/last_scenario.yaml -> /etc/foreman-installer/scenarios.d/capsule.yaml

>>> capsule-installer is tried as default_program = capsule and script then runs {@options[:program]}-installer

Comment 1 Lukas Pramuk 2022-05-11 12:30:25 UTC
There is a workaround to symlink capsule-installer to satellite-installer

# mv /usr/sbin/capsule-installer{,.orig}
# ln -s satellite-installer /usr/sbin/capsule-installer

Comment 2 Evgeni Golov 2022-05-11 14:33:55 UTC
Created redmine issue https://projects.theforeman.org/issues/34896 from this bug

Comment 3 Bryan Kearney 2022-05-11 16:04:58 UTC
Upstream bug assigned to egolov

Comment 4 Bryan Kearney 2022-05-11 16:05:00 UTC
Upstream bug assigned to egolov

Comment 6 Lukas Pramuk 2022-05-23 10:02:04 UTC
VERIFIED.

@Satellite 6.11.0 Snap21
katello-common-4.3.0-2.el7sat.noarch

by the following manual reproducer:

1) @Satellite: Generate capsule certs for the new hostname and copy it to capsule

# capsule-certs-generate --foreman-proxy-fqdn capsule-new.example.com --certs-tar capsule-new.example.com-certs.tar 

# scp capsule-new.example.com-certs.tar capsule.example.com:/root


2) @Capsule: Create /etc/hosts record and run satellite-change-hostname

# echo 127.0.0.1 capsule-new.example.com > /etc/hosts

# satellite-change-hostname capsule-new.example.com -u admin -p changeme -c /root/capsule-new.example.com-certs.tar -y
Checking for certs tarball

Checking hostname validity
updating hostname in /etc/hostname
setting hostname
checking if hostname was changed
stopping services
removing old cert rpms
No Match for argument: capsule.example.com-apache*
No Match for argument: capsule.example.com-foreman-client*
No Match for argument: capsule.example.com-foreman-proxy*
No Match for argument: capsule.example.com-foreman-proxy-client*
No Match for argument: capsule.example.com-puppet-client*
No Match for argument: capsule.example.com-qpid-broker*
No Match for argument: capsule.example.com-qpid-client-cert*
No Match for argument: capsule.example.com-qpid-router-client*
No Match for argument: capsule.example.com-qpid-router-server*
No Match for argument: capsule.example.com-tomcat*
deleting old certs
backed up /var/www/html/pub to /var/www/html/pub/capsule.example.com-20220523054123.backup
updating hostname in /etc/hosts
updating hostname in foreman installer scenarios
backing up last_scenario.yaml
removing last_scenario.yaml
re-running the installer
foreman-installer --scenario capsule -v --disable-system-checks --foreman-proxy-register-in-foreman false --certs-tar-file /root/capsule-new.example.com-certs.tar
cleaning up temporary files
2022-05-23 05:41:30 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-05-23 05:41:36 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-05-23 05:41:36 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-05-23 05:41:43 [WARN  ] [pre] Skipping system checks.
2022-05-23 05:41:43 [WARN  ] [pre] Skipping system checks.
2022-05-23 05:41:48 [NOTICE] [configure] Starting system configuration.
2022-05-23 05:41:58 [NOTICE] [configure] 250 configuration steps out of 1226 steps complete.
2022-05-23 05:42:07 [NOTICE] [configure] 500 configuration steps out of 1231 steps complete.
2022-05-23 05:42:08 [NOTICE] [configure] 750 configuration steps out of 1231 steps complete.
2022-05-23 05:42:09 [NOTICE] [configure] 1000 configuration steps out of 1235 steps complete.
2022-05-23 05:42:41 [NOTICE] [configure] System configuration has finished.
  Success!
  * Capsule is running at https://capsule-new.example.com:9090

  The full log is at /var/log/foreman-installer/capsule.log
Restarting puppet services
**** Hostname change complete! ****
IMPORTANT:
You will have to update the Name and URL of the Smart Proxy in Foreman to the new hostname.

>>> satellite-change-hostname on capsule runs correct installer script (foreman-installer)

Comment 9 errata-xmlrpc 2022-07-05 14:35:32 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 (Moderate: Satellite 6.11 Release), 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/RHSA-2022:5498


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