Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd and config: align rhel custom files with upstream #1431

Merged
merged 2 commits into from
May 18, 2022

Conversation

esposem
Copy link
Contributor

@esposem esposem commented May 5, 2022

Proposed Commit Message

So far RHEL had its own custom .service and cloud.cfg files,
that diverged from upstream. We always replaced the generated files
with the ones we had.

This caused only confusion and made it harder to rebase and backport
patches targeting these files.
Hopefully this brings some alignment with upstream.
At the same time, we are going to delete our custom downstream-only files
and use the ones generated by .tmpl.

The mapping is
config/cloud.cfg.tmpl -> rhel/cloud.cfg
systemd/* -> rhel/systemd/*

Such rhel-specific files are open and available in the Centos repo:
https://gitlab.com/redhat/centos-stream/src/cloud-init

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>

RHBZ 2082071

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

@esposem
Copy link
Contributor Author

esposem commented May 5, 2022

@TheRealFalcon @raharper Hi!
I am (finally) trying to align rhel config and systemd files with cloud-init.
This is still work in progress, as we need to make sure that everything works as it should on our side too, but wanted to have some first impression and feedbacks from you too.
Thank you in advance

@esposem esposem force-pushed the align_upstream_config branch from 36a1e8b to 23cd642 Compare May 5, 2022 11:13
@esposem
Copy link
Contributor Author

esposem commented May 5, 2022

@esposem esposem force-pushed the align_upstream_config branch 2 times, most recently from 8899a22 to 3b8f074 Compare May 5, 2022 11:57
@esposem esposem changed the title Draft: systemd and config: align rhel custom files with upstream Systemd and config: align rhel custom files with upstream May 5, 2022
@esposem esposem marked this pull request as draft May 6, 2022 14:18
@esposem esposem force-pushed the align_upstream_config branch 2 times, most recently from 83412a8 to 3b8f074 Compare May 9, 2022 07:13
@esposem esposem marked this pull request as ready for review May 9, 2022 07:34
@TheRealFalcon
Copy link
Member

@esposem , thanks for this! It will be good to bring things closer to upstream.

Comparing yours to the rhel-specific files you linked, I noticed a few differences:

  • cloud-init-local.service: Yours missing line ExecStart=/bin/touch /run/cloud-init/network-config-ready.
  • cloud-init.service: Yours includes DefaultDependencies=no
  • cloud.cfg: A number of modules are re-ordered (or added from upstream)

Are all of these intentional?

Additionally, have you been able to build and test your changes?

@esposem
Copy link
Contributor Author

esposem commented May 13, 2022

@TheRealFalcon you are right, I did not notice these differences in cloud-init-local.service and cloud-init.service.
Regarding cloud.cfg, does order matter? I don't think so, right?
In any case, our order is probably pretty much outdated, so keeping yours should be fine.

Regarding testing yes, we have tested the changes (without the above you suggested), and all seems to work fine 🎉

@esposem esposem force-pushed the align_upstream_config branch from 3b8f074 to 9608095 Compare May 13, 2022 08:00
@esposem
Copy link
Contributor Author

esposem commented May 13, 2022

Oh sorry I understand what you mean with cloud.cfg. If you mean some modules are in the wrong section cloud_final_modules vs cloud_config_modules, it's an error from our side that actually caused also bugs. That's also why I am trying to align everything with upstream, because the static rhel/ files were not updated and were always replacing the upstream files.

For example, we have an issue that requires the puppet module to be moved in cloud_final_modules, but upstream the module is already placed there! It's just us that never updated rhel/ to reflect it, therefore your fix got lost downstream.

Anyways I am pushing again, I think some modules are supported by rhel (at least, by looking at distros = [... "rhel" ] in their cc_module.py file). I don't think it will hurt us having additional modules (which were supposed to be there anyways following the various releases and rebases).

@esposem esposem force-pushed the align_upstream_config branch from 9608095 to eabda6e Compare May 13, 2022 08:46
@esposem
Copy link
Contributor Author

esposem commented May 13, 2022

* `cloud-init-local.service`: Yours missing line `ExecStart=/bin/touch /run/cloud-init/network-config-ready`.

Actually, this was dropped in #1315
Therefore I think we should drop it too.
I was wrong. This PR is too new, not backported into RHEL yet. Centos is on release 22.1, therefore this PR has not landed in yet. I will not modify the diff, so this line will stay as default in Centos for all distros, until we backport your PR or rebase.

I will test the whole build again, and see if everything works as expected. But I don't see why it shouldn't.

@esposem esposem force-pushed the align_upstream_config branch from eabda6e to a92d538 Compare May 13, 2022 09:01
So far RHEL had its own custom .service and cloud.cfg files,
that diverged from upstream. We always replaced the generated files
with the ones we had.

This caused only confusion and made it harder to rebase and backport
patches targeting these files.
Hopefully this brings some alignment with upstream.
At the same time, we are going to delete our custom downstream-only files
and use the ones generated by .tmpl.

The mapping is
config/cloud.cfg.tmpl -> rhel/cloud.cfg
systemd/* -> rhel/systemd/*

Such rhel-specific files are open and available in the Centos repo:
https://gitlab.com/redhat/centos-stream/src/cloud-init

With this commit, we are also introducing modules in cloud.cfg that
were not in the default rhel cfg file, even though they should already
have been there with previous rebases and releases.
Anyways such modules support rhel as distro, and
therefore should cause no harm.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
@esposem esposem force-pushed the align_upstream_config branch from a92d538 to c81c964 Compare May 13, 2022 09:25
@TheRealFalcon
Copy link
Member

Once the build passes, let me know and I'll approve the PR.

Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @esposem for pushing this content upstream. changeset looks pretty good, I am just trying to wrap my head around the intent behind a couple of changes. Please see questions inline.

systemd/cloud-config.service.tmpl Show resolved Hide resolved
config/cloud.cfg.tmpl Outdated Show resolved Hide resolved
systemd/cloud-config.service.tmpl Show resolved Hide resolved
config/cloud.cfg.tmpl Show resolved Hide resolved
systemd/cloud-final.service.tmpl Show resolved Hide resolved
systemd/cloud-init-local.service.tmpl Show resolved Hide resolved
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @esposem for pushing these changes upstream.

@otubo
Copy link
Contributor

otubo commented May 18, 2022

Just reviewed the PR and LGTM too. Thanks for taking that, @esposem. Huge benefit for everyone 👍

@esposem
Copy link
Contributor Author

esposem commented May 18, 2022

@TheRealFalcon @blackboxsw downstream tests passed, feel free to merge this PR 🎉

@holmanb holmanb merged commit 9624758 into canonical:main May 18, 2022
nazunalika added a commit to nazunalika/cloud-init that referenced this pull request Jan 10, 2023
The previous change in PR canonical#1887 attempted to fix some issues created by
PR's canonical#1431 and canonical#1639. Unfortunately this change wrongly assumed all
derivatives were not expecting cloud-user. This attempts to correct that.
nazunalika added a commit to nazunalika/cloud-init that referenced this pull request Jan 10, 2023
The previous change in PR canonical#1887 attempted to fix some issues created by
PR's canonical#1431 and canonical#1639. Unfortunately this change wrongly assumed all
derivatives were not expecting cloud-user. This attempts to correct
that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants