The create_file
action can be used to drop files on disk without the need to
loudly invoke a shell and use cat
or echo
. Check out the TTP below to see
how it works:
TTPForge/example-ttps/actions/create-file/basic.yaml
Lines 1 to 22 in 7634dc6
You can experiment with the above TTP by installing the examples
TTP
repository (skip this if ttpforge list repos
shows that the examples
repo is
already installed):
ttpforge install repo https://github.com/facebookincubator/TTPForge --name examples
and then running the below command:
ttpforge run examples//actions/create-file/basic.yaml
You can specify the following YAML fields for the create_file:
action:
create_file:
(type:string
) the path to the file you want to create.contents:
(type:string
) the contents that you want placed in the new file.overwrite:
(type:bool
) whether the file should be overwritten if it already exists.mode:
the octal permission mode (chmod
style) for the new file.cleanup:
you can set this todefault
in order to automatically cleanup the created file, or define a custom cleanup action.