summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_scripts_vendor.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_scripts_vendor.py')
-rw-r--r--cloudinit/config/cc_scripts_vendor.py70
1 files changed, 47 insertions, 23 deletions
diff --git a/cloudinit/config/cc_scripts_vendor.py b/cloudinit/config/cc_scripts_vendor.py
index 1b30fa1b..894404f8 100644
--- a/cloudinit/config/cc_scripts_vendor.py
+++ b/cloudinit/config/cc_scripts_vendor.py
@@ -3,35 +3,59 @@
# Author: Ben Howard <ben.howard@canonical.com>
#
# This file is part of cloud-init. See LICENSE file for license information.
-
-"""
-Scripts Vendor
---------------
-**Summary:** run vendor scripts
-
-Any scripts in the ``scripts/vendor`` directory in the datasource will be run
-when a new instance is first booted. Scripts will be run in alphabetical order.
-Vendor scripts can be run with an optional prefix specified in the ``prefix``
-entry under the ``vendor_data`` config key.
-
-**Internal name:** ``cc_scripts_vendor``
-
-**Module frequency:** per instance
-
-**Supported distros:** all
-
-**Config keys**::
-
- vendor_data:
- prefix: <vendor data prefix>
-"""
+"""Scripts Vendor: Run vendor scripts"""
import os
+from textwrap import dedent
from cloudinit import subp, util
+from cloudinit.config.schema import MetaSchema, get_meta_doc
+from cloudinit.distros import ALL_DISTROS
from cloudinit.settings import PER_INSTANCE
-frequency = PER_INSTANCE
+MODULE_DESCRIPTION = """\
+On select Datasources, vendors have a channel for the consumption
+of all supported user data types via a special channel called
+vendor data. Any scripts in the ``scripts/vendor`` directory in the datasource
+will be run when a new instance is first booted. Scripts will be run in
+alphabetical order. This module allows control over the execution of
+vendor data.
+"""
+
+meta: MetaSchema = {
+ "id": "cc_scripts_vendor",
+ "name": "Scripts Vendor",
+ "title": "Run vendor scripts",
+ "description": MODULE_DESCRIPTION,
+ "distros": [ALL_DISTROS],
+ "frequency": PER_INSTANCE,
+ "examples": [
+ dedent(
+ """\
+ vendor_data:
+ enabled: true
+ prefix: /usr/bin/ltrace
+ """
+ ),
+ dedent(
+ """\
+ vendor_data:
+ enabled: true
+ prefix: [timeout, 30]
+ """
+ ),
+ dedent(
+ """\
+ # Vendor data will not be processed
+ vendor_data:
+ enabled: false
+ """
+ ),
+ ],
+}
+
+__doc__ = get_meta_doc(meta)
+
SCRIPT_SUBDIR = "vendor"