summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorAdrian Wilkins <adrian.wilkins@infinityworks.com>2020-04-28 16:55:34 +0100
committerGitHub <noreply@github.com>2020-04-28 11:55:34 -0400
commitb70f11079e6d4264ff9a8c12089945f57d903e28 (patch)
treedf50579332842188ac05bf488454df57e73e81aa /cloudinit
parentf5e1d67bf6faf400749ca192c3394c3356b2654e (diff)
downloadvyos-cloud-init-b70f11079e6d4264ff9a8c12089945f57d903e28.tar.gz
vyos-cloud-init-b70f11079e6d4264ff9a8c12089945f57d903e28.zip
Add docs about creating parent folders (#330)
Clarify in documentation that write_files will create parent folders for paths that do not already exist. This obfuscates what the problem is when people erroneously create files in /tmp despite the warnings in the documentation not to do so. People naturally assume that their file is absent because the parent folder did not exist for it to be created in, causing them to add a runcmd block to create the folder, even though execution order means that this will not occur until after write_files have all finished.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_write_files.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/cloudinit/config/cc_write_files.py b/cloudinit/config/cc_write_files.py
index 16ea80e2..204cbfd6 100644
--- a/cloudinit/config/cc_write_files.py
+++ b/cloudinit/config/cc_write_files.py
@@ -43,6 +43,7 @@ schema = {
'title': 'write arbitrary files',
'description': dedent("""\
Write out arbitrary content to files, optionally setting permissions.
+ Parent folders in the path are created if absent.
Content can be specified in plain text or binary. Data encoded with
either base64 or binary gzip data can be specified and will be decoded
before being written. For empty file creation, content can be omitted.