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' } -%>