diff options
author | Brett Holman <brett.holman@canonical.com> | 2022-05-18 11:23:42 -0600 |
---|---|---|
committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2022-05-19 03:21:09 +0000 |
commit | 15d691e3b0b32c67b0589665b49e9d2755296d1b (patch) | |
tree | bece25885ecb96f5b0adcc6941d5f56826e3eb93 /cloudinit/config/cc_scripts_vendor.py | |
parent | 0210cd6f20d1c11410ba78409bd235cb4f7a6def (diff) | |
download | cloud-init-git-15d691e3b0b32c67b0589665b49e9d2755296d1b.tar.gz |
22.2-0ubuntu1~22.10.1 (patches unapplied)
Imported using git-ubuntu import.
Diffstat (limited to 'cloudinit/config/cc_scripts_vendor.py')
-rw-r--r-- | cloudinit/config/cc_scripts_vendor.py | 70 |
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" |