Allow additional preseed overrides
Sometimes the ephemeral environment needs additional cloud-init data. This change allows user-data sections to be added to the default files in /etc/maas/preseeds: enlist, commissioning, and curtin. For example, to resolve issues with 'apt-get update' failures during enlistment, something like this may be necessary: conf: cloudconfig: override: true sections: bootcmd: - "rm -fr /var/lib/apt/lists" Change-Id: I817006a799003ace3f35d02507489720b0f9079b
This commit is contained in:
parent
ccfbd4340f
commit
35fa3175e3
@ -52,3 +52,11 @@ data:
|
|||||||
{{ tuple "etc/_logrotate.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "etc/_logrotate.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
logrotate.cron: |
|
logrotate.cron: |
|
||||||
{{ tuple "etc/_logrotate.cron.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "etc/_logrotate.cron.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
{{- if .Values.conf.cloudconfig.override }}
|
||||||
|
enlist: |+
|
||||||
|
{{ tuple "etc/_enlist.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
commissioning: |+
|
||||||
|
{{ tuple "etc/_commissioning.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
curtin: |+
|
||||||
|
{{ tuple "etc/_curtin.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
4
charts/maas/templates/etc/_commissioning.tpl
Normal file
4
charts/maas/templates/etc/_commissioning.tpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{{ "{{" }}preseed_data{{ "}}" }}
|
||||||
|
{{- range $k, $v := .Values.conf.cloudconfig.sections }}
|
||||||
|
{{ dict $k $v | toYaml | trim }}
|
||||||
|
{{- end }}
|
4
charts/maas/templates/etc/_curtin.tpl
Normal file
4
charts/maas/templates/etc/_curtin.tpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{{ "{{" }}preseed_data{{ "}}" }}
|
||||||
|
{{- range $k, $v := .Values.conf.cloudconfig.sections }}
|
||||||
|
{{ dict $k $v | toYaml | trim }}
|
||||||
|
{{- end }}
|
13
charts/maas/templates/etc/_enlist.tpl
Normal file
13
charts/maas/templates/etc/_enlist.tpl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#cloud-config
|
||||||
|
datasource:
|
||||||
|
MAAS:
|
||||||
|
timeout : 50
|
||||||
|
max_wait : 120
|
||||||
|
# there are no default values for metadata_url or oauth credentials
|
||||||
|
# If no credentials are present, non-authed attempts will be made.
|
||||||
|
metadata_url: {{ "{{" }}metadata_enlist_url{{ "}}" }}
|
||||||
|
|
||||||
|
output: {all: '| tee -a /var/log/cloud-init-output.log'}
|
||||||
|
{{- range $k, $v := .Values.conf.cloudconfig.sections }}
|
||||||
|
{{ dict $k $v | toYaml | trim }}
|
||||||
|
{{- end }}
|
@ -155,6 +155,20 @@ spec:
|
|||||||
subPath: ntpd.sh
|
subPath: ntpd.sh
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.conf.cloudconfig.override }}
|
||||||
|
- name: maas-etc
|
||||||
|
mountPath: /etc/maas/preseeds/enlist
|
||||||
|
subPath: enlist
|
||||||
|
readOnly: true
|
||||||
|
- name: maas-etc
|
||||||
|
mountPath: /etc/maas/preseeds/commissioning
|
||||||
|
subPath: commissioning
|
||||||
|
readOnly: true
|
||||||
|
- name: maas-etc
|
||||||
|
mountPath: /etc/maas/preseeds/curtin
|
||||||
|
subPath: curtin
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
{{- if $mounts_maas_region.volumeMounts }}{{ toYaml $mounts_maas_region.volumeMounts | indent 12 }}{{ end }}
|
{{- if $mounts_maas_region.volumeMounts }}{{ toYaml $mounts_maas_region.volumeMounts | indent 12 }}{{ end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: host-sys-fs-cgroup
|
- name: host-sys-fs-cgroup
|
||||||
|
@ -192,6 +192,21 @@ conf:
|
|||||||
# Example:
|
# Example:
|
||||||
# late_commands:
|
# late_commands:
|
||||||
# install_modules_extra: ["curtin", "in-target", "--", "apt-get", "-y", "install", "linux-modules-extra-4.15.0-88-generic"]
|
# install_modules_extra: ["curtin", "in-target", "--", "apt-get", "-y", "install", "linux-modules-extra-4.15.0-88-generic"]
|
||||||
|
cloudconfig:
|
||||||
|
override: false
|
||||||
|
sections: {}
|
||||||
|
# Additional user-data sections to add to the default cloud-config.
|
||||||
|
# These apply to the ephemeral environment, used during enlistment,
|
||||||
|
# commissioning, and deployment (pre-curtin).
|
||||||
|
# In particular, bootcmd may be useful:
|
||||||
|
# https://cloudinit.readthedocs.io/en/latest/topics/modules.html#bootcmd
|
||||||
|
# Example:
|
||||||
|
# conf:
|
||||||
|
# cloudconfig:
|
||||||
|
# override: true
|
||||||
|
# sections:
|
||||||
|
# bootcmd:
|
||||||
|
# - "rm -fr /var/lib/apt/lists"
|
||||||
drydock:
|
drydock:
|
||||||
bootaction_url: null
|
bootaction_url: null
|
||||||
cache:
|
cache:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user