From c4afe0b24777999f8eaba29cbdaf51aa5f2ae832 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 --- .../provisioning_templates/cloud_init/cloud_init_default.erb | 5 +++++ 1 file changed, 5 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..15e49eecd96 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 @@ -43,6 +43,11 @@ runcmd: - | <%= indent(2) { snippet 'fix_hosts' } -%> - | +<% if @host.provision_method == 'image' && root_pass.present? -%> + # Install the root password + echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e +<% end -%> +- | <%= indent(2) { snippet 'yum_proxy' } -%> - | <%= indent(2) { snippet 'ntp' } -%>