diff --git a/_toc.yml b/_toc.yml index 2e85fd1d..a4fcf332 100644 --- a/_toc.yml +++ b/_toc.yml @@ -84,6 +84,7 @@ chapters: - file: admin-guide/configuration/files/afs - file: admin-guide/configuration/files/mount - file: admin-guide/configuration/files/distribute_files + - file: admin-guide/configuration/files/systemd_tmpfiles - file: admin-guide/configuration/files/partitioning - file: admin-guide/configuration/files/resize_vm_disk - file: admin-guide/configuration/files/nfs_server diff --git a/admin-guide/configuration/files/systemd_tmpfiles.md b/admin-guide/configuration/files/systemd_tmpfiles.md new file mode 100644 index 00000000..680a3fab --- /dev/null +++ b/admin-guide/configuration/files/systemd_tmpfiles.md @@ -0,0 +1,30 @@ +# systemd-tmpfiles + +[`systemd-tmpfiles`](https://www.freedesktop.org/software/systemd/man/latest/systemd-tmpfiles.html) can be used to create, delete, and clean up files and directories. +The system-wide configuration is in [`/etc/tmpfiles.d/*.conf`](https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html). + + +## Hiera Configuration + +In Hiera below `profile::tmpfiles:` you can set several use cases (here `podman`) with individual configuration at `content` which contains the full configuration as documented in [`tmpfiles.d(5)`](https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html): + +``` +profile::tmpfiles: + podman: + content: | + # This file is distributed by Puppet: profile::tmpfiles + # See tmpfiles.d(5) for details + + # Remove podman temporary directories on each boot + # https://github.com/containers/podman/discussions/23193 + R! /tmp/containers-user-* + R! /tmp/podman-run-* +``` + +To undo above configuration requires + +``` +profile::tmpfiles: + podman: + ensure: absent +```