From 600b870b399feb9e072748e07ea223556261fbe7 Mon Sep 17 00:00:00 2001 From: Chris Lalos Date: Thu, 10 Feb 2022 15:49:38 -0600 Subject: Shell script handlers by freq (#1166) Handlers for per-boot/per-instance/per-once multipart MIME Add handlers for adding scripts to userdata that can be run at various frequencies. Scripts of type x-shellscript-per-boot, x-shellscript-per-instance, or x-shellscript-per-once can be added to a multipart MIME userdata message as part of instance userdata. These scripts will then be added to the appropriate per-boot, per-instance, or per-once directory in /var/lib/cloud/scripts/ during processing of userdata. --- cloudinit/handlers/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cloudinit/handlers/__init__.py') diff --git a/cloudinit/handlers/__init__.py b/cloudinit/handlers/__init__.py index 62c1fd26..7d8a9208 100644 --- a/cloudinit/handlers/__init__.py +++ b/cloudinit/handlers/__init__.py @@ -50,6 +50,13 @@ INCLUSION_TYPES_MAP = { "#cloud-config-archive": "text/cloud-config-archive", "#cloud-config-jsonp": "text/cloud-config-jsonp", "## template: jinja": "text/jinja2", + # Note: for the next 3 entries, the prefix doesn't matter because these + # are for types that can only be used as part of a MIME message. However, + # including these entries supresses warnings during `cloudinit devel + # make-mime`, which otherwise would require `--force`. + "text/x-shellscript-per-boot": "text/x-shellscript-per-boot", + "text/x-shellscript-per-instance": "text/x-shellscript-per-instance", + "text/x-shellscript-per-once": "text/x-shellscript-per-once", } # Sorted longest first -- cgit v1.2.3