summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-12-20 12:02:39 -0500
committerScott Moser <smoser@ubuntu.com>2011-12-20 12:02:39 -0500
commitb17a271da699230be8dad5d8c0227a5c7c238503 (patch)
treefc0f9419f83f8533cf6d6259b45c195795f4bb94 /doc
parent13015ef25fa7e748e916c99f083e338b28861a18 (diff)
parent57a28850fae6098a32e7c16ab90541fd785684cb (diff)
downloadvyos-cloud-init-b17a271da699230be8dad5d8c0227a5c7c238503.tar.gz
vyos-cloud-init-b17a271da699230be8dad5d8c0227a5c7c238503.zip
add INSTANCE_ID to env of bootcmd, add cloud-init-per
the environment varible INSTANCE_ID is set when invoking boothooks from multi-part input. However, previously that was not the case for things run via bootcmd. This adds cloud-init-per, which makes it easy for user in bootcmd or boothook to do something per 'instance', 'always', or 'once'. The functionality in cloud-init-per mostly duplicated what was in cloud-init-run-module. That supported "modules", but it is unlikely that it was used for anything other than "execute". So, cloud-init-per now replaces cloud-init-run-module and provides legacy support for the 'execute' path.
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/cloud-config.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt
index d67b572c..4f621274 100644
--- a/doc/examples/cloud-config.txt
+++ b/doc/examples/cloud-config.txt
@@ -228,9 +228,13 @@ runcmd:
# in the boot process, only slightly after a 'boothook' would run.
# bootcmd should really only be used for things that could not be
# done later in the boot process. bootcmd is very much like
-# boothook, but possibly with more friendly
+# boothook, but possibly with more friendly.
+# * bootcmd will run on every boot
+# * the INSTANCE_ID variable will be set to the current instance id.
+# * you can use 'cloud-init-boot-per' command to help only run once
bootcmd:
- echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
+ - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ]
# cloud_config_modules:
# default: