diff options
author | James Falcon <james.falcon@canonical.com> | 2022-02-11 20:02:11 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 19:02:11 -0700 |
commit | a62d04e081831be82b3d26c94fee5aa40d7c0802 (patch) | |
tree | ce9f56a84e5d84f17867df79183eb4f406328393 | |
parent | 6dc67d732a92536dd42947af60cf4bfb25411489 (diff) | |
download | vyos-cloud-init-a62d04e081831be82b3d26c94fee5aa40d7c0802.tar.gz vyos-cloud-init-a62d04e081831be82b3d26c94fee5aa40d7c0802.zip |
Docs for x-shellscript* userdata (#1260)
-rw-r--r-- | doc/rtd/topics/format.rst | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/doc/rtd/topics/format.rst b/doc/rtd/topics/format.rst index 6d790b05..93ef34f0 100644 --- a/doc/rtd/topics/format.rst +++ b/doc/rtd/topics/format.rst @@ -38,6 +38,9 @@ Supported content-types are listed from the cloud-init subcommand make-mime: x-include-once-url x-include-url x-shellscript + x-shellscript-per-boot + x-shellscript-per-instance + x-shellscript-per-once Helper subcommand to generate mime messages @@ -47,13 +50,26 @@ The cloud-init subcommand can generate MIME multi-part files: `make-mime`_. ``make-mime`` subcommand takes pairs of (filename, "text/" mime subtype) separated by a colon (e.g. ``config.yaml:cloud-config``) and emits a MIME -multipart message to stdout. An example invocation, assuming you have your -cloud config in ``config.yaml`` and a shell script in ``script.sh`` and want -to store the multipart message in ``user-data``: +multipart message to stdout. + +Examples +-------- +Create userdata containing both a cloud-config (``config.yaml``) +and a shell script (``script.sh``) + +.. code-block:: shell-session + + $ cloud-init devel make-mime -a config.yaml:cloud-config -a script.sh:x-shellscript > userdata + +Create userdata containing 3 shell scripts: + +- ``always.sh`` - Run every boot +- ``instance.sh`` - Run once per instance +- ``once.sh`` - Run once .. code-block:: shell-session - $ cloud-init devel make-mime -a config.yaml:cloud-config -a script.sh:x-shellscript > user-data + $ cloud-init devel make-mime -a always.sh:x-shellscript-per-boot -a instance.sh:x-shellscript-per-instance -a once.sh:x-shellscript-per-once .. _make-mime: https://github.com/canonical/cloud-init/blob/main/cloudinit/cmd/devel/make_mime.py |