theforeman/foreman — pull request #1982 by TJM (2014-11-26 03:53:37+00:00)
Title: 8498 Add the ability to access root_pass (hashed root password) for finish scripts

This fixes the ability to access the root_pass attribute, and ensures that its loaded. It also includes an updated default kickstart template that actually *sets* the root password on a "image" based install. (with the assumption that the root password will be set by the provision script otherwise so setting it again would be unnecessary).

Since the "finish" script will not get loaded automatically, in order to test this, add the following to a finish script for a centos/rhel/fedora based install.. I am not sure if it works on debian or gentoo based images.

```
<% if @host.provision_method == 'image' && ! root_pass.blank? -%>
# Install the root password
echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e
<% end -%>
```