You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a field called 'Parent' which is used to specify a file's parent
directory. When a parent is specified, all directories from the parent to
the file will be created, with the 'mode' supplied in the parent directory.
resolves: coreos#380
Co-authored-by: Yasmin Valim <[email protected]>
Co-authored-by: Joseph Corchado <[email protected]>
Co-authored-by: Adam Piasecki <[email protected]>
Copy file name to clipboardexpand all lines: docs/config-fcos-v1_6-exp.md
+3
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,9 @@ The Fedora CoreOS configuration is a YAML document conforming to the following s
117
117
***_group_** (object): specifies the file's group.
118
118
***_id_** (integer): the group ID of the group.
119
119
***_name_** (string): the group name of the group.
120
+
***_parent_** (object): the parent directory for the specified file, by declaring a parent the directories from the parent to the file's target destination.
121
+
***_path_** (string): the path of the directory within the file's 'path'.
122
+
***_mode_** (integer): directory modes are set to 0755 as a default if not specified and directory does not exist prior to the specified file.
120
123
***_directories_** (list of objects): the list of directories to be created. Every file, directory, and link must have a unique `path`.
121
124
***path** (string): the absolute path to the directory.
122
125
***_overwrite_** (boolean): whether to delete preexisting nodes at the path. If false and a directory already exists at the path, Ignition will only set its permissions. If false and a non-directory exists at that path, Ignition will fail. Defaults to false.
Copy file name to clipboardexpand all lines: docs/config-fiot-v1_1-exp.md
+3
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,9 @@ The Fedora IoT configuration is a YAML document conforming to the following spec
88
88
***_group_** (object): specifies the file's group.
89
89
***_id_** (integer): the group ID of the group.
90
90
***_name_** (string): the group name of the group.
91
+
***_parent_** (object): the parent directory for the specified file, by declaring a parent the directories from the parent to the file's target destination.
92
+
***_path_** (string): the path of the directory within the file's 'path'.
93
+
***_mode_** (integer): directory modes are set to 0755 as a default if not specified and directory does not exist prior to the specified file.
91
94
***_directories_** (list of objects): the list of directories to be created. Every file, directory, and link must have a unique `path`.
92
95
***path** (string): the absolute path to the directory.
93
96
***_overwrite_** (boolean): whether to delete preexisting nodes at the path. If false and a directory already exists at the path, Ignition will only set its permissions. If false and a non-directory exists at that path, Ignition will fail. Defaults to false.
Copy file name to clipboardexpand all lines: docs/config-flatcar-v1_2-exp.md
+3
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,9 @@ The Flatcar configuration is a YAML document conforming to the following specifi
117
117
***_group_** (object): specifies the file's group.
118
118
***_id_** (integer): the group ID of the group.
119
119
***_name_** (string): the group name of the group.
120
+
***_parent_** (object): the parent directory for the specified file, by declaring a parent the directories from the parent to the file's target destination.
121
+
***_path_** (string): the path of the directory within the file's 'path'.
122
+
***_mode_** (integer): directory modes are set to 0755 as a default if not specified and directory does not exist prior to the specified file.
120
123
***_directories_** (list of objects): the list of directories to be created. Every file, directory, and link must have a unique `path`.
121
124
***path** (string): the absolute path to the directory.
122
125
***_overwrite_** (boolean): whether to delete preexisting nodes at the path. If false and a directory already exists at the path, Ignition will only set its permissions. If false and a non-directory exists at that path, Ignition will fail. Defaults to false.
Copy file name to clipboardexpand all lines: docs/config-openshift-v4_17-exp.md
+3
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,9 @@ The OpenShift configuration is a YAML document conforming to the following speci
107
107
***_group_** (object): specifies the file's group.
108
108
***_id_** (integer): the group ID of the group.
109
109
***_name_** (string): the group name of the group.
110
+
***_parent_** (object): the parent directory for the specified file, by declaring a parent the directories from the parent to the file's target destination.
111
+
***_path_** (string): the path of the directory within the file's 'path'.
112
+
***_mode_** (integer): directory modes are set to 0755 as a default if not specified and directory does not exist prior to the specified file.
110
113
***_luks_** (list of objects): the list of luks devices to be created. Every device must have a unique `name`.
111
114
***name** (string): the name of the luks device.
112
115
***device** (string): the absolute path to the device. Devices are typically referenced by the `/dev/disk/by-*` symlinks.
Copy file name to clipboardexpand all lines: docs/config-r4e-v1_2-exp.md
+3
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,9 @@ The RHEL for Edge configuration is a YAML document conforming to the following s
88
88
***_group_** (object): specifies the file's group.
89
89
***_id_** (integer): the group ID of the group.
90
90
***_name_** (string): the group name of the group.
91
+
***_parent_** (object): the parent directory for the specified file, by declaring a parent the directories from the parent to the file's target destination.
92
+
***_path_** (string): the path of the directory within the file's 'path'.
93
+
***_mode_** (integer): directory modes are set to 0755 as a default if not specified and directory does not exist prior to the specified file.
91
94
***_directories_** (list of objects): the list of directories to be created. Every file, directory, and link must have a unique `path`.
92
95
***path** (string): the absolute path to the directory.
93
96
***_overwrite_** (boolean): whether to delete preexisting nodes at the path. If false and a directory already exists at the path, Ignition will only set its permissions. If false and a non-directory exists at that path, Ignition will fail. Defaults to false.
Copy file name to clipboardexpand all lines: docs/examples.md
+17
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,23 @@ storage:
149
149
mode: 0644
150
150
```
151
151
152
+
This example creates a file at `/opt/foo/bar/file.txt` with the contents `Hello, world!`, permissions 0644 (so readable and writable by the owner, and only readable by everyone else). Additionally is specifies a parent directory at `/opt/foo` with permissions 0644, which ensure that if the directories between `/opt/foo` and `/opt/foo/bar/file.txt` (i.e `/opt/foo`, `/opt/foo/bar`) do not exist, they will be created with the specified permissions. Use this to avoid having to create directories separately, with the correct permissions.
153
+
154
+
<!-- butane-config -->
155
+
```yaml
156
+
variant: fcos
157
+
version: 1.6.0-experimental
158
+
storage:
159
+
files:
160
+
- path: /opt/foo/bar/file.txt
161
+
contents:
162
+
inline: Hello, world!
163
+
mode: 0644
164
+
parent:
165
+
- path: /opt/foo
166
+
mode: 0644
167
+
```
168
+
152
169
### Directory trees
153
170
154
171
Consider a directory tree at `~/conf/tree` on the system running Butane:
0 commit comments