summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-13 11:18:22 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-13 11:18:22 -0500
commit2113e89b6816d2c9d442103698414cd189ca3412 (patch)
treedcb45a31fe393994c6c7c6a7956d4b0b187c21da /doc
parent58886d757ebd832e8c0de45981a51242370d40fc (diff)
downloadvyos-cloud-init-2113e89b6816d2c9d442103698414cd189ca3412.tar.gz
vyos-cloud-init-2113e89b6816d2c9d442103698414cd189ca3412.zip
implement power_state with tests.
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/cloud-config.txt39
1 files changed, 21 insertions, 18 deletions
diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt
index 4fc5f351..09298655 100644
--- a/doc/examples/cloud-config.txt
+++ b/doc/examples/cloud-config.txt
@@ -256,24 +256,6 @@ bootcmd:
- echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
- [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ]
-# final commands
-# default: none
-# This can be used to execute commands after and fully detached from
-# a cloud-init stage. The initial purpose of it was to allow 'poweroff'
-# detached from cloud-init. If poweroff was run from 'runcmd' or userdata
-# then messages may be spewed from cloud-init about logging failing or other
-# issues as a result of the system being turned off.
-#
-# You probably are better off using 'runcmd' for this.
-#
-# The output of finalcmd will redirected redirected to /dev/null
-# If you want output to be seen, take care to do so in your commands
-# themselves. See example.
-finalcmd:
- - sleep 30
- - "echo $(date -R): powering off > /dev/console"
- - /sbin/poweroff
-
# cloud_config_modules:
# default:
# cloud_config_modules:
@@ -596,3 +578,24 @@ manual_cache_clean: False
# A list of key types (first token of a /etc/ssh/ssh_key_*.pub file)
# that should be skipped when outputting key fingerprints and keys
# to the console respectively.
+
+## poweroff or reboot system after finished
+# default: none
+#
+# power_state can be used to make the system shutdown, reboot or
+# halt after boot is finished. This same thing can be acheived by
+# user-data scripts or by runcmd by simply invoking 'shutdown'.
+#
+# Doing it this way ensures that cloud-init is entirely finished with
+# modules that would be executed, and avoids any error/log messages
+# that may go to the console as a result of system services like
+# syslog being taken down while cloud-init is running.
+#
+# delay: form accepted by shutdown. default is 'now'. other format
+# accepted is +m (m in minutes)
+# mode: required. must be one of 'poweroff', 'halt', 'reboot'
+# message: provided as the message argument to 'shutdown'. default is none.
+power_state:
+ delay: 30
+ mode: poweroff
+ message: Bye Bye