From 843089243b06cdac7c4d1dd1e5aa9aa11bd766fc Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Sat, 20 Jun 2020 18:57:42 +0000 Subject: [PATCH] Allow additional late_commands in curtin userdata This change allows extra late_commands to be added to the curtin userdata, which are executed before the node is rebooted at the end of the deployment. This can be useful to install packages or perform other customization. One sample use-case is the installation of specific kernel module packages that match the target kernel image, in cases where the ephemeral environment uses a different kernel version. Change-Id: I80084c544f6a7dafd6aa84c8041cf86bdc3b9f4b --- charts/maas/templates/etc/_curtin_userdata.tpl | 3 +++ charts/maas/values.yaml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/charts/maas/templates/etc/_curtin_userdata.tpl b/charts/maas/templates/etc/_curtin_userdata.tpl index 414ea72..eeb6236 100644 --- a/charts/maas/templates/etc/_curtin_userdata.tpl +++ b/charts/maas/templates/etc/_curtin_userdata.tpl @@ -71,6 +71,9 @@ def find_ba_key(n): driver_06_depmod: ["curtin", "in-target", "--", "depmod"] driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"] {{ "{{" }}endif{{ "}}" }} +{{- range $k, $v := .Values.conf.curtin.late_commands }} +{{ dict $k $v | toYaml | trim | indent 2 }} +{{- end }} showtrace: true swap: size: 0 diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml index 3ed06c7..e6cc1a6 100644 --- a/charts/maas/values.yaml +++ b/charts/maas/values.yaml @@ -183,6 +183,15 @@ conf: append: curtin: override: true + late_commands: {} + # Additional commands to be run during the "late" curtin stage + # https://curtin.readthedocs.io/en/latest/topics/config.html#stages + # When naming the keys, consider that the commands are executed in + # lexicographic order. The existing late_commands are named: + # driver_NN_*, drydock_NN, and maas + # Example: + # late_commands: + # install_modules_extra: ["curtin", "in-target", "--", "apt-get", "-y", "install", "linux-modules-extra-4.15.0-88-generic"] drydock: bootaction_url: null cache: