OL9: Behavior regression in cloud-init-22.1-6.0.1 with module cc_write_files_deferred
Closed this issue · 1 comments
Background: cloud-init upstream added the cc_write_files_deferred module in release 21.4, to account for the scenario where a file is to be written to the volume with a specific owner, who is created using the cc_users_groups module during cloud-init execution. This is because the cc_write_files module is run prior to the cc_users_groups module.
Example cloud-init config that should work according to upstream docs:
#cloud-config
groups:
- newgroup
users:
- name: newuser
primary_group: newgroup
write_files:
- path: /opt/testfile
content: SGVsbG8gV29ybGQ=
encoding: b64
permissions: '0644'
owner: newuser:newgroup
defer: true
The defer: true line means this entry should be run by cc_write_files_deferred
Observed Behavior: In recent OL9 builds, this file will never be written.
Expected Behavior: The file should be written with the correct ownership.
Running the module manually using cloud-init single --name cc_write_files_deferred --frequency always --report will cause cloud-init to demonstrate Expected Behavior.
Observations in the sRPM: There is a patch in the source that references orabug 34845400. This patch contains a Jinja2 conditional on the cc_write_files_deferred module in the /etc/cloud/cloud.cfg template that only activates it for non-Oracle Linux systems.
The /etc/cloud/cloud.cfg has the deferred module enabled on cloud-init-22.1-5.0.1.el9. In the subsequent release, the patch was added and the bug was introduced.
The attached patch file (tested with rpmbuild on 23.4-7.0.1.el9_4.5) can be added into the spec to remove the conditional and resolve the issue.
Oracle Linux customers, please file your issue at https://support.oracle.com
Thanks for filing an issue with Oracle Linux.
GitHub Issues is not an official support channel and we don't offer
product support here. If you're not yet an Oracle Linux customer,
consider signing up at https://linux.oracle.com.
Even if you're not a customer, if we can confirm that an issue is a
bug we will do our best to fix it and to update this issue
once it has been fixed. We don't guarantee a fix or feedback and
for now, we will close this issue. If you have Oracle Linux support,
please use support.oracle.com to report issues.