Integration w/ Drydock bootactions
- Add Values.conf.curtin.override switch for enabling/disable whether the default curtin_userdata is overwritten - Update the customized template for curtin_userdata to be compatible with the Drydock boot action system Change-Id: I90c317725dfdd34a756e90425c9c3fcfcc6911db
This commit is contained in:
parent
a2e8188b81
commit
4b43a7dbd8
|
@ -33,17 +33,7 @@ metadata:
|
||||||
name: maas-etc
|
name: maas-etc
|
||||||
data:
|
data:
|
||||||
curtin_userdata: |+
|
curtin_userdata: |+
|
||||||
{{ if .Values.conf.curtin.override -}}
|
|
||||||
{{ .Values.conf.curtin.override | indent 4 }}
|
|
||||||
{{- else -}}
|
|
||||||
{{- if .Values.conf.curtin.prefix -}}
|
|
||||||
{{ .Values.conf.curtin.prefix | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{ tuple "etc/_curtin_userdata.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "etc/_curtin_userdata.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.conf.curtin.append -}}
|
|
||||||
{{ .Values.conf.curtin.append | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
named.conf.options: |+
|
named.conf.options: |+
|
||||||
{{ if .Values.conf.bind.override -}}
|
{{ if .Values.conf.bind.override -}}
|
||||||
{{ .Values.conf.bind.override | indent 4 }}
|
{{ .Values.conf.bind.override | indent 4 }}
|
||||||
|
|
|
@ -24,17 +24,31 @@ early_commands:
|
||||||
driver_00: ["sh", "-c", "echo third party drivers not installed or necessary."]
|
driver_00: ["sh", "-c", "echo third party drivers not installed or necessary."]
|
||||||
{{ "{{" }}endif{{ "}}" }}
|
{{ "{{" }}endif{{ "}}" }}
|
||||||
late_commands:
|
late_commands:
|
||||||
{{ "{{" }}py: bootdata_url = ''.join([{{ .Values.bootdata_url | quote }},node.hostname,"/promconfig"]){{ "}}" }}
|
{{ "{{" }}py:
|
||||||
{{ "{{" }}py: promsvc_url = ''.join([{{ .Values.bootdata_url | quote }},node.hostname,"/promservice"]){{ "}}" }}
|
def find_ba_key(n):
|
||||||
{{ "{{" }}py: vfsvc_url = ''.join([{{ .Values.bootdata_url | quote }},node.hostname,"/vfservice"]){{ "}}" }}
|
tag_prefix = "%s_baid" % n.hostname
|
||||||
{{ "{{" }}py: prominit_url = ''.join([{{ .Values.bootdata_url | quote }},node.hostname,"/prominit"]){{ "}}" }}
|
for t in n.tag_names():
|
||||||
drydock_01: ["curtin", "in-target","--", "wget", "--no-proxy", "{{ "{{" }}bootdata_url{{ "}}" }}", "-O", "/etc/prom_init.yaml"]
|
if t.startswith(tag_prefix):
|
||||||
drydock_02: ["curtin", "in-target","--", "wget", "--no-proxy", "{{ "{{" }}prominit_url{{ "}}" }}", "-O", "/var/tmp/prom_init.sh"]
|
prefix, ba_key = t.split('-')
|
||||||
drydock_03: ["curtin", "in-target","--", "chmod", "555", "/var/tmp/prom_init.sh"]
|
return ba_key
|
||||||
drydock_04: ["curtin", "in-target","--", "wget", "--no-proxy", "{{ "{{" }}promsvc_url{{ "}}" }}", "-O", "/lib/systemd/system/prom_init.service"]
|
return False
|
||||||
drydock_05: ["curtin", "in-target","--", "systemctl", "enable", "prom_init.service"]
|
{{ "}}" }}
|
||||||
drydock_06: ["curtin", "in-target","--", "wget", "--no-proxy", "{{ "{{" }}vfsvc_url{{ "}}" }}", "-O", "/lib/systemd/system/drydock_vf.service"]
|
{{ "{{" }}py: ba_key = find_ba_key(node){{ "}}" }}
|
||||||
drydock_07: ["curtin", "in-target","--", "systemctl", "enable", "drydock_vf.service"]
|
{{ "{{" }}py: ba_units_url = ''.join([{{ .Values.conf.drydock.bootaction_url | quote }},node.hostname,'/units']){{ "}}" }}
|
||||||
|
{{ "{{" }}py: ba_files_url = ''.join([{{ .Values.conf.drydock.bootaction_url | quote }},node.hostname,'/files']){{ "}}" }}
|
||||||
|
{{ "{{" }}if ba_key{{ "}}" }}
|
||||||
|
drydock_00: ["sh", "-c", "echo Installing Drydock Boot Actions."]
|
||||||
|
drydock_01: ["curtin", "in-target", "--", "wget", "--no-proxy", "--header=X-Bootaction-Key: {{ "{{" }}ba_key{{ "}}" }}", "{{ "{{" }}ba_units_url{{ "}}" }}", "-O", "/tmp/bootaction-units.tar.gz"]
|
||||||
|
drydock_02: ["curtin", "in-target", "--", "wget", "--no-proxy", "--header=X-Bootaction-Key: {{ "{{" }}ba_key{{ "}}" }}", "{{ "{{" }}ba_files_url{{ "}}" }}", "-O", "/tmp/bootaction-files.tar.gz"]
|
||||||
|
drydock_03: ["curtin", "in-target", "--", "sh", "-c", "tar --owner=root -xPzvf /tmp/bootaction-units.tar.gz > /tmp/bootaction-unit-names.txt"]
|
||||||
|
drydock_04: ["curtin", "in-target", "--", "sh", "-c", "tar --owner=root -xPzvf /tmp/bootaction-files.tar.gz > /tmp/bootaction-file-names.txt"]
|
||||||
|
drydock_05: ["curtin", "in-target", "--", "sh", "-c", "xargs -a /tmp/bootaction-unit-names.txt -n 1 basename > /tmp/bootaction-unit-basenames.txt"]
|
||||||
|
drydock_06: ["curtin", "in-target", "--", "sh", "-c", "xargs -a /tmp/bootaction-unit-basenames.txt -n 1 systemctl enable"]
|
||||||
|
drydock_07: ["sh", "-c", "echo Following SystemD units installed and enabled:"]
|
||||||
|
drydock_08: ["curtin", "in-target", "--", "cat", "/tmp/bootaction-unit-basenames.txt"]
|
||||||
|
drydock_09: ["sh", "-c", "echo Following files installed on deployed node:"]
|
||||||
|
drydock_10: ["curtin", "in-target", "--", "cat", "/tmp/bootaction-file-names.txt"]
|
||||||
|
{{ "{{" }}}endif{{ "}}" }}
|
||||||
maas: [wget, '--no-proxy', {{ "{{" }}node_disable_pxe_url|escape.json{{ "}}" }}, '--post-data', {{ "{{" }}node_disable_pxe_data|escape.json{{ "}}" }}, '-O', '/dev/null']
|
maas: [wget, '--no-proxy', {{ "{{" }}node_disable_pxe_url|escape.json{{ "}}" }}, '--post-data', {{ "{{" }}node_disable_pxe_data|escape.json{{ "}}" }}, '-O', '/dev/null']
|
||||||
{{ "{{" }}if third_party_drivers and driver{{ "}}" }}
|
{{ "{{" }}if third_party_drivers and driver{{ "}}" }}
|
||||||
{{ "{{" }}if driver['key_binary'] and driver['repository'] and driver['package']{{ "}}" }}
|
{{ "{{" }}if driver['key_binary'] and driver['repository'] and driver['package']{{ "}}" }}
|
||||||
|
@ -50,4 +64,6 @@ late_commands:
|
||||||
{{ "{{" }}endif{{ "}}" }}
|
{{ "{{" }}endif{{ "}}" }}
|
||||||
driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
|
driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
|
||||||
driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"]
|
driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"]
|
||||||
{{ "{{" }}endif{{ "}}" }}
|
{{ "{{" }}endif{{ "}}" }}
|
||||||
|
showtrace: true
|
||||||
|
verbosity: 2
|
||||||
|
|
|
@ -66,10 +66,12 @@ spec:
|
||||||
mountPath: /etc/maas/regiond.conf
|
mountPath: /etc/maas/regiond.conf
|
||||||
subPath: regiond.conf
|
subPath: regiond.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- if .Values.conf.curtin.override }}
|
||||||
- name: maas-etc
|
- name: maas-etc
|
||||||
mountPath: /etc/maas/preseeds/curtin_userdata
|
mountPath: /etc/maas/preseeds/curtin_userdata
|
||||||
subPath: curtin_userdata
|
subPath: curtin_userdata
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
- name: maas-bin
|
- name: maas-bin
|
||||||
mountPath: /tmp/start.sh
|
mountPath: /tmp/start.sh
|
||||||
subPath: start.sh
|
subPath: start.sh
|
||||||
|
|
|
@ -110,8 +110,9 @@ conf:
|
||||||
override:
|
override:
|
||||||
append:
|
append:
|
||||||
curtin:
|
curtin:
|
||||||
override:
|
override: true
|
||||||
append:
|
drydock:
|
||||||
|
bootaction_url: null
|
||||||
maas:
|
maas:
|
||||||
override:
|
override:
|
||||||
append:
|
append:
|
||||||
|
|
Loading…
Reference in New Issue