quadlet: add support for multiple quadlets in a single file

Enable installing multiple quadlets from one file using '---' delimiters.
Each section requires '# FileName=<name>' comment for custom naming.
Single quadlet files remain unchanged for backward compatibility.

Assited by: claude-4-sonnet

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
This commit is contained in:
flouthoc
2025-10-26 22:38:36 -07:00
parent 17beac160c
commit e787b4f503
3 changed files with 462 additions and 6 deletions

View File

@@ -16,6 +16,8 @@ This command allows you to:
* Specify a directory containing multiple Quadlet files and other non-Quadlet files for installation ( example a config file for a quadlet container ).
* Install multiple Quadlets from a single file with `.quadlets` extension where each Quadlet is separated by a `---` delimiter. When using multiple quadlets in a single file, each quadlet section must include a `# FileName=<name>` comment to specify the name for that quadlet.
Note: If a quadlet is part of an application, removing that specific quadlet will remove the entire application. When a quadlet is installed from a directory, all files installed from that directory—including both quadlet and non-quadlet files—are considered part of a single application.
Note: In case user wants to install Quadlet application then first path should be the path to application directory.
@@ -59,5 +61,34 @@ $ podman quadlet install https://github.com/containers/podman/blob/main/test/e2e
/home/user/.config/containers/systemd/basic.container
```
Install multiple quadlets from a single .quadlets file
```
$ cat webapp.quadlets
# FileName=web-server
[Container]
Image=nginx:latest
ContainerName=web-server
PublishPort=8080:80
---
# FileName=app-storage
[Volume]
Label=app=webapp
---
# FileName=app-network
[Network]
Subnet=10.0.0.0/24
$ podman quadlet install webapp.quadlets
/home/user/.config/containers/systemd/web-server.container
/home/user/.config/containers/systemd/app-storage.volume
/home/user/.config/containers/systemd/app-network.network
```
Note: Multi-quadlet functionality requires the `.quadlets` file extension. Files with other extensions will only be processed as single quadlets or asset files.
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-quadlet(1)](podman-quadlet.1.md)**