Skip to content

Commit

Permalink
managing-files: Add example for non root ownership
Browse files Browse the repository at this point in the history
Add an example for non root ownership for files and parent directories

See: #441
  • Loading branch information
mohelt authored and travier committed Sep 28, 2022
1 parent 6303cf3 commit e56a202
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions modules/ROOT/pages/managing-files.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
----

0 comments on commit e56a202

Please sign in to comment.