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

New podman::quadlet type for quadlet production #83

Closed
wants to merge 1 commit into from

Conversation

traylenator
Copy link
Contributor

@traylenator traylenator commented Feb 27, 2024

Assuming at least podman 4.4.0 the new type podman::quadlet will create a quadlet unit file for a container, volume or pod which will in turn generate a service unit for managing the resulting container, volume or pod.

Note that pod quadlets require podman at least version 5.

Testing with a simple puppet file:

# test.pp
podman::quadlet{'centos.container':
  ensure          => present,
  unit_entry     => {
   'Description' => 'Trivial Container that will be very lazy',
  },
  service_entry       => {
    'TimeoutStartSec' => '900',
  },
  container_entry => {
    'Image' => 'quay.io/centos/centos:latest',
    'Exec'  => 'sh -c "sleep inf'
  },
  install_entry   => {
    'WantedBy' => 'default.target'
  },
  active          => true,
}

Results in a running container.

@traylenator
Copy link
Contributor Author

@southalc time to look at this?
There's a load to do after this but want to run this basic bit past you first before creating a lot more of the same.

@breca
Copy link

breca commented Mar 28, 2024

This looks great! Would love to play with this.

Not sure if it's intentional but some of your files/classes are named quadret

i.e types/quadret/container.pp / Podman::Quadret::Container

@traylenator
Copy link
Contributor Author

Not sure if it's intentional but some of your files/classes are named quadret

i.e types/quadret/container.pp / Podman::Quadret::Container

That's indeed a typo from me - will correct.

@traylenator
Copy link
Contributor Author

Been looking at this myself a bit today - I'd probably do it different than this

podman::quadlet is much more sensible choice - they are very much all the same.

@southalc
Copy link
Owner

Thanks for your work and contribution to the project. I'm sorry about being slow to respond. I'm not as active here since changing jobs.
This is an interesting capability and can really simplify this module. I was reviewing the docs and saw that podman quadlet supports container, volume, network, kube, image, and pod. I like the idea of implementing this as a more generic defined type "podman::quadlet" that supports resources of all these types. Are you already working on this per your comment the other day?

@traylenator
Copy link
Contributor Author

I do indeed have a branch I'm playing with - more to do I'll update this one or provide a new one later this week.

I'm not as active here since changing jobs.

voxpupuli ?

@traylenator traylenator changed the title New podman::manage_container type for container unit New podman::quadlet type for quadlet production Apr 3, 2024
@traylenator
Copy link
Contributor Author

@southalc everything stuffed into podman::quadlet now. Only container, volume and pod done but others easy enough to do for someone.

@traylenator
Copy link
Contributor Author

Hi.

A ping basically - voxpupuli ? There's a load of new stuff in the systemd module just released and we could rework a lot of whats here and make this module smaller - all the handling of user units is now in that module.

types/unit/container.pp Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Assuming at least podman 4.4.0 the new type `podman::quadlet`
will create a quadlet unit files for a container, volume or pod
which will in turn generate a service unit for managing the container,
pod or volume.

Boot root and rootless containers are supported.

The included examples are operational however.

Note that pod quadlets are only supported with podman 5.
@southalc
Copy link
Owner

I finally got around to this, although I see the voxpupuli module has since been stood up. Anyway, I implemented quadlets as a defined type where you can just define the parameters as a hash that gets converted to systemd unit files. This avoids the need to define a hard list of supported parameters and should allow the module to support future keywords to quadlet files with no module changes. I also switched over rootless users and services to use the systemd module instead of the collection of exec resources used previously.
I'm going to close this request since I'm guessing your work is basically the voxpupuli implementation.

@southalc southalc closed this Nov 17, 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.

RFC - Quadlet Support
5 participants