Skip to content

Commit

Permalink
New podman::quadlet type for quadlet units
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
traylenator committed Apr 3, 2024
1 parent fb3ce01 commit e99a2ce
Show file tree
Hide file tree
Showing 17 changed files with 1,059 additions and 185 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
---
fixtures:
forge_modules:
systemd: "puppet/systemd"
stdlib: "puppetlabs/stdlib"
concat: "puppetlabs/concat"
selinux_core: "puppetlabs/selinux_core"
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,36 @@ Several additional examples are in a separate [github project](https://github.co
a Traefik container configuration that enables SSL termination and proxy access to other containers running on the host, with a dynamic
configuration directory enabling updates to proxy rules as new containers are added and/or removed.

## Creating Containers,Volumes, Pods, ... with Quadlet Unit Files

Container unit files can be created and managed, for example:

```puppet
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,
}
```

Will create a service `centos.service` that is then started and enabled for boot.

Similarly quadlets for volumes, pods, ... can be created in a similar manner


## Limitations

The module was written and tested with RedHat/CentOS, but should work with any distribution that uses systemd and includes
Expand Down
Loading

0 comments on commit e99a2ce

Please sign in to comment.