From 604c194d97150fe3310a51cabd351e1df6d18755 Mon Sep 17 00:00:00 2001 From: Sayan Das Date: Wed, 9 Oct 2024 21:35:52 +0530 Subject: [PATCH] Fixes #37901 - Set root password through Cloudinit deployments --- .../cloud_init/cloud_init_default.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/unattended/provisioning_templates/cloud_init/cloud_init_default.erb b/app/views/unattended/provisioning_templates/cloud_init/cloud_init_default.erb index 6df0e79c2b4..b0c830d1baa 100644 --- a/app/views/unattended/provisioning_templates/cloud_init/cloud_init_default.erb +++ b/app/views/unattended/provisioning_templates/cloud_init/cloud_init_default.erb @@ -39,6 +39,12 @@ hostname: <%= @host.name %> fqdn: <%= @host %> manage_etc_hosts: true users: {} +<% if @host.provision_method == 'image' && root_pass.present? -%> +chpasswd: + expire: False + users: + - {name: root, password: <%= root_pass -%>} +<% end -%> runcmd: - | <%= indent(2) { snippet 'fix_hosts' } -%>