Bug #35028
closedConfigure Cloud Connector runs against an old hostname after a hostname change
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2094255
Description of problem:
Cloud Connector installation job fails because it tries to run against an old (before hostname change + satellite-change-hostname) hostname instead of the correct one. The job is shown as executed against an incorrect host and this host is also used in the playbook itself:
```
1:
[WARNING]: Callback disabled by environment. Disabling the Foreman callback
2:
plugin.
3:
4:
PLAY [all] *************************************************************
5:
6:
TASK [Gathering Facts] *************************************************
7:
fatal: [<OLD_FQDN>]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
8:
PLAY RECAP *************************************************************
9:
<OLD_FQDN> : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
10:
Exit status: 1
```
Egolov found out that there are two hosts that are marked as "foreman=true" in the DB:
irb(main):003:0> a = ::Host.unscoped.search_for('infrastructure_facet.foreman = true')
=> #<ActiveRecord::Relation [#<Host::Managed id: 1, name: "<OLD_FQDN>", last_compile: nil, last_report: nil, updated_at: "2022-05-26 06:08:52", created_at: "2022-05-26 06:08:50", root_pass: nil, archite...
irb(main):004:0> a.length
=> 2
Also, egolov states that since rh_cloud 5.0.32, this is one of the ways RH Cloud detects the hostname. And indeed, with its previous version, this bug didn't manifest.
I am reporting the bug against satellite-change-hostname because the data is wrong in the database after running it. Yet, this is a regression (effectively, because it was possible to Configure Cloud Connector and now it is not) immediately caused by including a new version of rh_cloud in the snap.
Version-Release number of selected component (if applicable):
Sat 6.11 snap 22, tfm-rubygem-foreman_rh_cloud-5.0.37-1.el7sat.noarch
Regression
How reproducible:
Deterministic
Steps to Reproduce:
1. Have a Satellite prepared to get cloud connecor configured (e.g. ssh keys copied, s-m registered, manifest uploaded etc.)
2. Run satellite-change-hostname
3. Attempt Configure -> Inventory Upload -> Configure Cloud connector
Actual results:
Failure, job run against an old hostname
Expected results:
Job run against a new hostname
Additional info:
See also bug 2042480
Updated by The Foreman Bot almost 2 years ago
- Status changed from New to Ready For Testing
- Assignee set to Evgeni Golov
- Pull request https://github.com/theforeman/foreman-packaging/pull/8048 added
Updated by Samir Jha almost 2 years ago
- Project changed from Katello to Packaging
- Subject changed from Configure Cloud Connector runs against an old hostname after a hostname change to Configure Cloud Connector runs against an old hostname after a hostname change
Updated by Evgeni Golov almost 2 years ago
- Status changed from Ready For Testing to Closed