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

Add support for podman quadlets #474

Closed
wants to merge 1 commit into from

Conversation

dabelenda
Copy link

Pull Request (PR) description

This PR adds support for podman Quadlets, a generator for systemd that creates units automatically for files in a specific folder.

Tested with a kube Yaml file and it starts the pod.

Comment on lines 62 to 63
String $owner = 'root',
String $group = 'root',
Copy link
Member

Choose a reason for hiding this comment

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

can you please update those so we don't allow empty string? String[1]

Copy link
Author

Choose a reason for hiding this comment

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

Done.
Note: it was copy-pasted from unit_file.pp

String[1] $owner = 'root',
String[1] $group = 'root',
String[1] $mode = '0444',
Optional[Boolean] $enable = undef,
Copy link
Member

Choose a reason for hiding this comment

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

do those booleans need to be undef or can we default to true or false?

Copy link
Author

Choose a reason for hiding this comment

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

Not mandatory, it was copy/pasted directly from unit_file.pp to keep a consistent API in the module.

If you request a change, I can remove the Optional, and set a default value.

@traylenator
Copy link
Contributor

I'd been thinking about doing this.

If this was going to be done I would at least steal the types I added in southalc/podman#83 so the contents of the quadlet files can be managed.

But I question if managing quadlets should be in here at all. These are not unit files processed by systemd. Having said that its easy place to have them and it will not intrude into systemd configuration.

I think a seperate quadlet module using as much of this module as possible would make more sense? Which I'm very happy to work on lifting much of what I did above. Result is somewhat we ignoring the existing podman module but that is fine for the sake of actual progress.

@dabelenda
Copy link
Author

@traylenator at least for unit_files this module does not manage the content of the files.

All type definitions and templating were created for the dropins. I copied the behavious of the unit_file.pp for everything which is why I did not add types.

I am also unsure if this is the correct spot for this, which is why I did not go all the way, like creating tests and managing the content of the quadlet files.

@ekohl
Copy link
Member

ekohl commented Jul 4, 2024

Like @traylenator I question it. It's not systemd, but podman. And even with podman you need a new version (4.4+ for basic support, which Debian 12 doesn't even have, newer for the more advanced features).

Given the lack of progress on southalc/podman#83 I wouldn't mind taking over that module. Ideally transferring but forking if needed.

@traylenator
Copy link
Contributor

southalc/podman#83 I wouldn't mind taking over that module. Ideally transferring but forking if needed.

It may actually be easier to start again with a puppet-quadlets module. The southcalc/podman has a load of very necessary at the time hard to do stuff which all becomes unnecessary with simplicity of quadlets. My preference would be new module rather than migration but I would happily work on either.

@ekohl
Copy link
Member

ekohl commented Jul 4, 2024

I currently don't use the podman module, but I can see how quadlets replace many of the old ways. A puppet-quadlets module sounds like a good plan to me.

@TheMeier
Copy link
Contributor

TheMeier commented Jul 5, 2024

To me it is also not really clear to which domains really belong. Podman? Systemd? I tend more towards podman, thats also where its code is now.

@dabelenda
Copy link
Author

I agree this is a bit fuzzy in terms of scope, the generator for quadlet is in the podman package. At the same time, there are generators for a bunch of "core" features of podman, like mount points, etc.

An additionnal puppet module for quadlets that installs podman, manages the content of quadlet files, might be a good thing.
Will the new module depend on puppet/systemd for management of daemon-reload or things like that? Will the module contain its own logic for managing service like puppet/systemd ?

Conceptually the two modues will be pretty similar in features I think.

@TheMeier
Copy link
Contributor

TheMeier commented Jul 5, 2024

If there is going to be a new module, I think it should re-use whatever it can from the systemd module

@traylenator
Copy link
Contributor

traylenator commented Jul 5, 2024

If there is going to be a new module, I think it should re-use whatever it can from the systemd module

Yes of course it would use systemd::user_service , systemd::daemon_reload for instance.

@dabelenda sounds like we have a plan. Unless more comment in next day or two I'll create repo puppet-quadlets and we can plan it out in an issue.

@traylenator
Copy link
Contributor

Add quadlet support in own module. - voxpupuli/puppet-quadlets#1

@dabelenda
Copy link
Author

Closing this PR since we agree that going for another module is the correct path.

@dabelenda dabelenda closed this Jul 8, 2024
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