summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-03 02:26:38 -0500
committerScott Moser <smoser@brickies.net>2017-03-03 02:26:38 -0500
commitd7004bcf269fe60e456de336ecda9a9d2fe50bfd (patch)
treecf49b1fbc06388d46fa435814d24d97c83476047 /doc
parent1de8720effd029727bb5ef7972e7e4d859a1b53a (diff)
parentc81ea53bbdc4ada9d2b52430e106aeb3c38b4e0a (diff)
downloadvyos-cloud-init-d7004bcf269fe60e456de336ecda9a9d2fe50bfd.tar.gz
vyos-cloud-init-d7004bcf269fe60e456de336ecda9a9d2fe50bfd.zip
merge from master at 0.7.9-47-gc81ea53
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/cloud-config.txt2
-rw-r--r--doc/rtd/topics/datasources/altcloud.rst4
-rw-r--r--doc/rtd/topics/datasources/openstack.rst36
-rw-r--r--doc/rtd/topics/format.rst13
4 files changed, 45 insertions, 10 deletions
diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt
index c5f84b13..c03f1026 100644
--- a/doc/examples/cloud-config.txt
+++ b/doc/examples/cloud-config.txt
@@ -200,7 +200,7 @@ ssh_import_id: [smoser]
#
# Default: none
#
-debconf_selections: | # Need to perserve newlines
+debconf_selections: | # Need to preserve newlines
# Force debconf priority to critical.
debconf debconf/priority select critical
diff --git a/doc/rtd/topics/datasources/altcloud.rst b/doc/rtd/topics/datasources/altcloud.rst
index 8646e77e..202b0a4a 100644
--- a/doc/rtd/topics/datasources/altcloud.rst
+++ b/doc/rtd/topics/datasources/altcloud.rst
@@ -66,7 +66,7 @@ NOTE: The file name on the ISO must be: ``user-data.txt``
.. sourcecode:: sh
- % cp simple_scirpt.bash my-iso/user-data.txt
+ % cp simple_script.bash my-iso/user-data.txt
% genisoimage -o user-data.iso -r my-iso
Verify the ISO
@@ -75,7 +75,7 @@ Verify the ISO
.. sourcecode:: sh
% sudo mkdir /media/vsphere_iso
- % sudo mount -o loop JoeV_CI_02.iso /media/vsphere_iso
+ % sudo mount -o loop user-data.iso /media/vsphere_iso
% cat /media/vsphere_iso/user-data.txt
% sudo umount /media/vsphere_iso
diff --git a/doc/rtd/topics/datasources/openstack.rst b/doc/rtd/topics/datasources/openstack.rst
index ea47ea85..164b0e0c 100644
--- a/doc/rtd/topics/datasources/openstack.rst
+++ b/doc/rtd/topics/datasources/openstack.rst
@@ -1,7 +1,41 @@
OpenStack
=========
-*TODO*
+This datasource supports reading data from the
+`OpenStack Metadata Service
+<http://docs.openstack.org/admin-guide/compute-networking-nova.html#metadata-service>`_.
+
+Configuration
+-------------
+The following configuration can be set for the datasource in system
+configuration (in `/etc/cloud/cloud.cfg` or `/etc/cloud/cloud.cfg.d/`).
+
+The settings that may be configured are:
+
+ * **metadata_urls**: This list of urls will be searched for an OpenStack
+ metadata service. The first entry that successfully returns a 200 response
+ for <url>/openstack will be selected. (default: ['http://169.254.169.254']).
+ * **max_wait**: the maximum amount of clock time in seconds that should be
+ spent searching metadata_urls. A value less than zero will result in only
+ one request being made, to the first in the list. (default: -1)
+ * **timeout**: the timeout value provided to urlopen for each individual http
+ request. This is used both when selecting a metadata_url and when crawling
+ the metadata service. (default: 10)
+ * **retries**: The number of retries that should be done for an http request.
+ This value is used only after metadata_url is selected. (default: 5)
+
+An example configuration with the default values is provided as example below:
+
+.. sourcecode:: yaml
+
+ #cloud-config
+ datasource:
+ OpenStack:
+ metadata_urls: ["http://169.254.169.254"]
+ max_wait: -1
+ timeout: 10
+ retries: 5
+
Vendor Data
-----------
diff --git a/doc/rtd/topics/format.rst b/doc/rtd/topics/format.rst
index ed87d3ed..436eb00f 100644
--- a/doc/rtd/topics/format.rst
+++ b/doc/rtd/topics/format.rst
@@ -127,11 +127,11 @@ Begins with: ``#cloud-boothook`` or ``Content-Type: text/cloud-boothook`` when u
Part Handler
============
-This is a ``part-handler``. It will be written to a file in ``/var/lib/cloud/data`` based on its filename (which is generated).
-This must be python code that contains a ``list_types`` method and a ``handle_type`` method.
-Once the section is read the ``list_types`` method will be called. It must return a list of mime-types that this part-handler handles.
+This is a ``part-handler``: It contains custom code for either supporting new mime-types in multi-part user data, or overriding the existing handlers for supported mime-types. It will be written to a file in ``/var/lib/cloud/data`` based on its filename (which is generated).
+This must be python code that contains a ``list_types`` function and a ``handle_part`` function.
+Once the section is read the ``list_types`` method will be called. It must return a list of mime-types that this part-handler handles. Because mime parts are processed in order, a ``part-handler`` part must precede any parts with mime-types it is expected to handle in the same user data.
-The ``handle_type`` method must be like:
+The ``handle_part`` function must be defined like:
.. code-block:: python
@@ -141,8 +141,9 @@ The ``handle_type`` method must be like:
# filename = the filename of the part (or a generated filename if none is present in mime data)
# payload = the parts' content
-Cloud-init will then call the ``handle_type`` method once at begin, once per part received, and once at end.
-The ``begin`` and ``end`` calls are to allow the part handler to do initialization or teardown.
+Cloud-init will then call the ``handle_part`` function once before it handles any parts, once per part received, and once after all parts have been handled.
+The ``'__begin__'`` and ``'__end__'`` sentinels allow the part handler to do initialization or teardown before or after
+receiving any parts.
Begins with: ``#part-handler`` or ``Content-Type: text/part-handler`` when using a MIME archive.