Skip to content

Commit

Permalink
doc: add doc for custom datasources (#5548)
Browse files Browse the repository at this point in the history
  • Loading branch information
aciba90 committed Jul 26, 2024
1 parent 3244c80 commit cf93b5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/rtd/development/datasource_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ Datasources included in upstream cloud-init benefit from ongoing maintenance,
compatibility with the rest of the codebase, and security fixes by the upstream
development team.

If this is not possible, one can add
:ref:`custom out-of-tree datasources to cloud-init<custom_datasource>`.

.. _make-mime: https://cloudinit.readthedocs.io/en/latest/explanation/instancedata.html#storage-locations
.. _DMI: https://www.dmtf.org/sites/default/files/standards/documents/DSP0005.pdf
Expand Down
2 changes: 2 additions & 0 deletions doc/rtd/reference/base_config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ Other keys
The :ref:`network configuration<network_config>` to be applied to this
instance.

.. _base_config_datasource_pkg_list:

``datasource_pkg_list``
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
15 changes: 15 additions & 0 deletions doc/rtd/reference/custom_modules/custom_datasource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,18 @@

Custom DataSource
*****************

Custom 3rd-party out-of-tree DataSources can be added to cloud-init by:

#. :ref:`Implement a DataSource<datasource_creation>` in a Python file.

#. Place that file in as a single Python module or package in folder included
in ``$PYTHONPATH``.

#. Extend the :ref:`base-configuration<base_config_reference>`'s
:ref:`datasource_pkg_list<base_config_datasource_pkg_list>` to include the
Python package where the DataSource is located.

#. Extend the :ref:`base-configuration<base_config_reference>`'s
:ref:`datasource_list<base_config_datasource_list>` to include the name of
the custom DataSource.

0 comments on commit cf93b5d

Please sign in to comment.