theforeman/foreman — pull request #1983 by TJM (2014-11-26 05:54:29+00:00)
Title: 8498 Add root_pass accessibility to 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). It also fixes the check to see if the password pasted was already hashed. (probably could use some documentation there)

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 -%>
```

This is a resubmit of my previous PR #1982 due to bad commit messages.