Repository navigation
Update User Scripts page - #10
BogdanEmilian wants to merge 3 commits into
Conversation
Provided a more detailed version for the User Script docs, while also adding a short step-by-step guide on how to run them and what to expect
|
|
||
|  | ||
|
|
||
|  |
There was a problem hiding this comment.
If these old images are not used any other place, they can be removed from the repo please.
There was a problem hiding this comment.
Removed the unused images.
Should I squash the commits into one?
This line was removed by mistake previously. Adding it back to not break any wp reference
mihaelabalutoiu
left a comment
There was a problem hiding this comment.
LGTM! Just left two small suggestions on the Windows examples.
| "This script ran at $(Get-Date)" | Out-File -FilePath $file -Encoding ascii | ||
| ``` | ||
|
|
||
| This has the same result as the after mount example above, with less to write, so you only need one of the two. |
There was a problem hiding this comment.
I think "same result" is a bit misleading, since the two examples do different things (one saves script_line1/script_line2, the other writes a file to the Desktop).
What they really share is the mechanism: for a first boot script, Coriolis itself writes it into Cloudbase-Init\LocalScripts (coriolis/osmorphing/windows.py), the same folder the after mount example writes to by hand. Maybe something like:
| This has the same result as the after mount example above, with less to write, so you only need one of the two. | |
| This runs through Cloudbase-Init LocalScripts too, like the after mount example above, but Coriolis writes the file for you, so you only need one of the two approaches. |
| An after mount script can also add a script for Cloudbase-Init to run at first boot: | ||
|
|
||
| ```powershell | ||
| $custom_script = @" |
There was a problem hiding this comment.
Small thing here: the example uses @"…"@, but the text below talks about @'…'@. It's more than a typo, since with double quotes PowerShell expands any $variables when the script runs on the worker, so a user's variables would end up empty in the saved file. Single quotes keep everything as written (docs).
| $custom_script = @" | |
| $custom_script = @' | |
| script_line1 | |
| script_line2 | |
| '@ |
Provided a more detailed version for the User Script docs, while also adding a short step-by-step guide on how to run them and what to expect