diff --git a/charts/maas/templates/etc/_curtin_userdata.tpl b/charts/maas/templates/etc/_curtin_userdata.tpl index 462b2cc..640cbef 100644 --- a/charts/maas/templates/etc/_curtin_userdata.tpl +++ b/charts/maas/templates/etc/_curtin_userdata.tpl @@ -73,3 +73,21 @@ def find_ba_key(n): {{ "{{" }}endif{{ "}}" }} showtrace: true verbosity: 2 +{{- if not (empty .Values.conf.maas.system_user) }} +{{- if not (empty .Values.conf.maas.system_passwd) }} +write_files: + # Create cloud-init config that configures the 'root' user as the + # default user instead of 'centos'. + # Additionally, enables password authentication for this user. + userconfig: + path: /etc/cloud/cloud.cfg.d/00-user.cfg + content: | + ssh_pwauth: yes + disable_root: false + system_info: + default_user: + name: {{ .Values.conf.maas.system_user | squote }} + lock_passwd: false + plain_text_passwd: {{ .Values.conf.maas.system_passwd | squote }} +{{- end }} +{{- end }} diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml index 4ab4c3d..dd6c1ec 100644 --- a/charts/maas/values.yaml +++ b/charts/maas/values.yaml @@ -235,6 +235,9 @@ conf: secret: namespace: maas name: maas-api-key + # system user for console login/recovery in early phases of deployment + system_user: 'root' + system_passwd: 'password' drivers: null #### If you populates drivers, it will replace the 3rd party driver #### info that comes with MaaS. see structure below if it is needed