Hi Chris,
On 15.06.23 at 15:54 Chris Evich wrote:
On 6/15/23 02:47, Johannes Kastl wrote:
> On 05.06.23 at 16:51 Chris Evich wrote:
>
>> 2. The playbook configures `quadlet` for `systemd` management of a
>> configuration (podman) volume and a pod with several containers in it running
>> services.
>
> Any reason for using quadlet via template instead of the containers.podman
> collection? Not sure if that solves the issue, but as quadlet is only a
> podman->systemd translator, you can get the same using ansible and
> containers.podman.
>
> And: My first idea would have been to use a handler to restart the systemd
> user services. Or is this what you mean by "restarting the pod"?
Re: `containers.podman` vs quadlet: Simply because if the container host
restarts or a container crashes unexpectedly, quadlet+systemd can ensure pods
come back up. I considered using cron + Ansible pull, but that seemed slightly
more complex/fragile.
You got me wrong. You can create systemd services for your pods etc. directly
via Ansible, without having to write the unit files yourself, even without
having quadlet (which is a nice piece of software, do not get me wrong) as
another layer in between.
Re: Use handler: Yeah, the handler uses systemd to restart services
(generated
by quadlet). The main problem is handlers run on change. But because
user-namespaces are in play, ansible's template module (rendering config files
into podman volumes) always thinks there's a "change" (i.e. in file or
directory
ownership) even if there isn't.
I never needed to fumble around with user namespaces until now, so my naive
question would be: Do you need to chown the files to the respective user
namespaces in the first place? I thought all of that was handled by podman in
the background?
Kind Regards,
Johannes
--
Johannes Kastl
Linux Consultant & Trainer
Tel.: +49 (0) 151 2372 5802
Mail: kastl(a)b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg
http://www.b1-systems.de
GF: Ralph Dehner
Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537