From 9c9cb78f0567d55fe322d26c5ccdb4c16b0160ff Mon Sep 17 00:00:00 2001 From: mohelt Date: Wed, 31 Aug 2022 12:50:39 +0100 Subject: [PATCH] managing-files: Add example for non root ownership Add an example for non root ownership for files and parent directories See: https://github.com/coreos/fedora-coreos-docs/issues/441 --- modules/ROOT/pages/managing-files.adoc | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/modules/ROOT/pages/managing-files.adoc b/modules/ROOT/pages/managing-files.adoc index f4b3b5c1..e929acd3 100644 --- a/modules/ROOT/pages/managing-files.adoc +++ b/modules/ROOT/pages/managing-files.adoc @@ -50,3 +50,47 @@ storage: target: /opt/tools/transmogrifier hard: false ---- + +If you need a directory and some of its parents to be owned by a specific user, +you currently have to explicitly list them in your Butane config. See +https://github.com/coreos/butane/issues/380[butane#380] for the tracking issue +in Butane for a future better syntax for this case. + +.Example to set permissions and ownership for a file and its parent directories +[source,yaml] +---- +variant: fcos +version: 1.4.0 +storage: + files: + - path: /home/builder/.config + user: + name: builder + group: + name: builder + - path: /home/builder/.config/systemd + user: + name: builder + group: + name: builder + - path: /home/builder/.config/systemd/user + user: + name: builder + group: + name: builder + - path: /home/builder/.config/systemd/user/default.target.wants + user: + name: builder + group: + name: builder + - path: /home/builder/.config/systemd/user/timers.target.wants + user: + name: builder + group: + name: builder + - path: /home/builder/.config/systemd/user/sockets.target.wants + user: + name: builder + group: + name: builder +----