RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2115565 - cloud-init configures user "centos" or "rhel" instead of "cloud-user" with cloud-init-22.1
Summary: cloud-init configures user "centos" or "rhel" instead of "cloud-user" with cl...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: cloud-init
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Emanuele Giuseppe Esposito
QA Contact: xiachen
URL:
Whiteboard:
Depends On:
Blocks: 2146547
TreeView+ depends on / blocked
 
Reported: 2022-08-04 22:49 UTC by Neal Gompa
Modified: 2023-05-09 08:18 UTC (History)
15 users (show)

Fixed In Version: cloud-init-22.1-6.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2115576 (view as bug list)
Environment:
Last Closed: 2023-05-09 07:30:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/src cloud-init merge_requests 33 0 None opened cloud.cfg.tmpl: make sure "centos" settings are identical to "rhel" (#1639) 2022-09-10 04:18:02 UTC
Red Hat Issue Tracker RHELPLAN-130342 0 None None None 2022-08-04 22:50:58 UTC
Red Hat Product Errata RHBA-2023:2183 0 None None None 2023-05-09 07:30:38 UTC

Description Neal Gompa 2022-08-04 22:49:41 UTC
Description of problem:
With the upgrade to cloud-init 22.1, CentOS/RHEL images have reverted back to "branded" users for the cloud-init user rather than the generic "cloud-user" that was being used before.

This change breaks automation and makes things particularly difficult for consumers to leverage RHEL/CentOS images.

Version-Release number of selected component (if applicable):
22.1-4.el9

How reproducible:
Always

Steps to Reproduce:
1. Boot the latest CentOS Stream cloud image
2. Attempt to log in with the "cloud-user"
3. Attempt to log in with the "centos" user

Actual results:
Login fails with "cloud-user" and succeeds with "centos"

Expected results:
Login succeeds with "cloud-user" and fails with "centos"

Additional info:
Originally, RHEL/CentOS used "cloud-user" with the custom cloud-init configuration files. Too much configuration was removed in the rebase to cloud-init v22.1.

Comment 1 xiachen 2022-08-08 02:01:55 UTC
@Eduardo @Emanuele,

In the patch "Align rhel custom files with upstream (#1431)", rhel and centos are treated differently, could you help to check it please? Should they use same configuration?


{% if variant in ["almalinux", "alpine", "amazon", "centos", "cloudlinux", "eurolinux",
                  "fedora", "miraclelinux", "openEuler", "rhel", "rocky", "virtuozzo"] %}
{% if variant == "rhel" %}
...

Comment 2 Emanuele Giuseppe Esposito 2022-08-08 07:49:08 UTC
PR: https://github.com/canonical/cloud-init/pull/1639

Comment 3 Neal Gompa 2022-08-08 08:05:24 UTC
I think the correct way to fix this would be to force the RHEL variant for generating configs, no?

That's what we do in the Fedora spec: https://src.fedoraproject.org/rpms/cloud-init/blob/rawhide/f/cloud-init.spec#_108-109

Comment 4 Neal Gompa 2022-08-08 08:10:58 UTC
To put it more clearly, the Fedora spec does this:

```
%py3_install -- --init-system=systemd 

# Generate cloud-config file 
python3 tools/render-cloudcfg --variant %{?rhel:rhel}%{!?rhel:fedora} > $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg
```

The RHEL spec does this:

```
%py3_install --

%if 0%{?fedora}
python3 tools/render-cloudcfg --variant fedora > $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg
%endif
```

It's pretty obvious the latter is wrong.

Comment 5 Emanuele Giuseppe Esposito 2022-08-08 08:21:23 UTC
Not really an expert on whatever the template language is, but {if 0} suggests me that this is not used.
Indeed we have below:
```
python3 tools/render-cloudcfg --variant rhel systemd/cloud-init-generator.tmpl > $RPM_BUILD_ROOT%{_systemdgeneratordir}/cloud-init-generator
```

Comment 13 errata-xmlrpc 2023-05-09 07:30:25 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 (cloud-init bug fix and enhancement update), 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-2023:2183


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