From 9f74c2122a20735ff373158b89e5a4a635688a28 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 --- modules/ROOT/pages/managing-files.adoc | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/ROOT/pages/managing-files.adoc b/modules/ROOT/pages/managing-files.adoc index f4b3b5c1..812823b0 100644 --- a/modules/ROOT/pages/managing-files.adoc +++ b/modules/ROOT/pages/managing-files.adoc @@ -50,3 +50,33 @@ storage: target: /opt/tools/transmogrifier hard: false ---- + +.Example for how to set permissions and ownership for a file and its parent directories +[source,yaml] +---- +variant: fcos +version: 1.4.0 +storage: + files: + # This creates a file, and sets the ownership + - path: /home/directory/you/want.txt + contents: + inline: Hello, world! + user: + name: exampleuser + group: + name: examplegroup + # This creates the directory that the file should be inside. Its mode is set to 0755 by default, that + # is, readable and executable by all, and writable by the owner. + directories: + - path: /home/directory + user: + name: exampleuser + group: + name: examplegroup + - path: /home/directory/you + user: + name: exampleuser + group: + name: examplegroup +----