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
This commit is contained in:
Phil Sphicas 2020-06-20 18:57:42 +00:00
parent 6f6c9b4aec
commit 843089243b
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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: