summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Holman <brett.holman@canonical.com>2022-05-26 22:23:28 +0200
committerGitHub <noreply@github.com>2022-05-26 14:23:28 -0600
commit04247f0330cc7a9e2455bea819625ab14e6c2ab2 (patch)
tree9064a9d51682e96ea7931d1de7f863f6c5ce5d2b
parent9c6acfc6dacc508097f4d48e43e4bd5d17f0145b (diff)
downloadcloud-init-git-04247f0330cc7a9e2455bea819625ab14e6c2ab2.tar.gz
doc: Document how to change module frequency (#1481)
-rw-r--r--doc/rtd/topics/faq.rst51
1 files changed, 48 insertions, 3 deletions
diff --git a/doc/rtd/topics/faq.rst b/doc/rtd/topics/faq.rst
index e4576f22..b2d40f34 100644
--- a/doc/rtd/topics/faq.rst
+++ b/doc/rtd/topics/faq.rst
@@ -182,6 +182,51 @@ Internal reasons:
- nonstandard configurations that disable timeouts or set extremely high
values ("never" is used in a loose sense here)
+How can I make a module run on every boot?
+==========================================
+Modules have a default frequency that can be overridden. This is done
+by modifying the module list in ``/etc/cloud/cloud.cfg``.
+
+1. Change the module from a string (default) to a list.
+2. Set the first list item to the module name and the second item to the
+ frequency.
+
+Example
+-------
+The following example demonstrates how to log boot times to a file every boot.
+
+Update ``/etc/cloud/cloud.cfg``:
+
+.. code-block:: yaml
+ :name: /etc/cloud/cloud.cfg
+ :emphasize-lines: 3
+
+ cloud_final_modules:
+ # list shortened for brevity
+ - [phone-home, always]
+ - final-message
+ - power-state-change
+
+
+
+Then your userdata could then be:
+
+.. code-block:: yaml
+
+ #cloud-config
+ phone_home:
+ url: http://example.com/$INSTANCE_ID/
+ post: all
+
+
+
+How can I test cloud-init locally before deploying to the cloud?
+================================================================
+
+Several different virtual machine and containerization tools can be used for
+testing locally. Multipass, LXD, and qemu are described in this section.
+
+
Multipass
---------
@@ -261,8 +306,8 @@ custom network config.
.. _Instance Configuration: https://linuxcontainers.org/lxd/docs/master/instances
.. _Custom Network Configuration: https://linuxcontainers.org/lxd/docs/master/cloud-init
-cloud-localds
--------------
+QEMU
+----
The `cloud-localds` command from the `cloud-utils`_ package generates a disk
with user supplied data. The NoCloud datasouce allows users to provide their
@@ -312,7 +357,7 @@ check out the :ref:`datasource_nocloud` page.
.. _cloud-utils: https://github.com/canonical/cloud-utils/
Where can I learn more?
-========================================
+=======================
Below are some videos, blog posts, and white papers about cloud-init from a
variety of sources.