From dbebd9262687b9f9c0ce921711229bde1ad785d5 Mon Sep 17 00:00:00 2001 From: James Howe <675056+OrangeDog@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:43:30 +0100 Subject: [PATCH] Fix documentation of file.prepend --- salt/states/file.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/salt/states/file.py b/salt/states/file.py index 4a5ee1719f18..d4688b18f8d6 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -6719,10 +6719,10 @@ def prepend( may specify a single line of text or a list of lines to append. name - The location of the file to append to. + The location of the file to prepend to. text - The text to be appended, which can be a single string or a list + The text to be prepended, which can be a single string or a list of strings. makedirs @@ -6732,7 +6732,7 @@ def prepend( creation of the named file. Defaults to False. source - A single source file to append. This source file can be hosted on either + A single source file to prepend. This source file can be hosted on either the salt master server, or on an HTTP or FTP server. Both HTTPS and HTTP are supported as well as downloading directly from Amazon S3 compatible URLs with both pre-configured and automatic IAM credentials @@ -6771,7 +6771,7 @@ def prepend( ` function for more details and examples. template - The named templating engine will be used to render the appended-to file. + The named templating engine will be used to render the source file(s). Defaults to ``jinja``. The following templates are supported: - :mod:`cheetah` @@ -6782,7 +6782,7 @@ def prepend( - :mod:`wempy` sources - A list of source files to append. If the files are hosted on an HTTP or + A list of source files to prepend. If the files are hosted on an HTTP or FTP server, the source_hashes argument is also required. source_hashes @@ -6802,6 +6802,10 @@ def prepend( appending content, one space or multiple tabs are the same for salt. Set this option to ``False`` if you want to change this behavior. + header + Forces the text to be prepended if it exists in the file but not at + the beginning. + Multi-line example: .. code-block:: yaml