From 5af724cff076dc9a2ba6bd79ff7538f42682be3e Mon Sep 17 00:00:00 2001 From: "Anderson, Craig (ca846m)" Date: Wed, 18 Mar 2020 13:24:46 -0700 Subject: [PATCH] Add ability to configure system account password Change-Id: Ifae2fa7d19472c601069ba9dff5b24396c2db338 --- charts/maas/templates/etc/_curtin_userdata.tpl | 18 ++++++++++++++++++ charts/maas/values.yaml | 3 +++ 2 files changed, 21 insertions(+) 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