From 4719f3a775005a575e3cd6b68fb249092d7c248d 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..db5ea5a3311 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 @@ -42,6 +42,11 @@ users: {} 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' } -%> - |