southalc / podman

Puppet module for podman
Apache License 2.0
13 stars 30 forks source link

New podman::quadlet type for quadlet production #83

Open traylenator opened 7 months ago

traylenator commented 7 months ago

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 commented 7 months ago

@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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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

traylenator commented 5 months ago

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.