Project

General

Profile

Download (1.1 KB) Statistics
| Branch: | Tag: | Revision:
logger "Starting finish script"

# Do not turn the machine off after 30 minutes. Very annoying!
/bin/touch /noautoshutdown

# Install the root password
/usr/bin/perl -p -i -e 's/^root:[^:]+/root:<%= @host.root_pass.gsub("/", '\/')-%>/' /etc/shadow

# Root can ssh into this box. This is very useful while we rebuild this
/usr/bin/perl -p -i -e "s/PermitRootLogin no/PermitRootLogin yes/" /etc/ssh/sshd_config

# Now ensure that we have the newest puppet and facter installed
/usr/bin/cp /var/pkg-get/admin-fullauto /var/pkg-get/admin > /dev/null
/opt/csw/bin/pkg-get -U
/opt/csw/bin/pkg-get -u -f CSWfacter CSWpuppet

echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippets "puppet.conf" -%>
EOF
# The x86 version of the puppet package ignores the --config parameter. This should fix that and not hurt other installations
if [ -f /etc/opt/csw/puppet/puppetd.conf ]
then
rm -f /etc/opt/csw/puppet/puppetd.conf
ln -s /etc/puppet/puppet.conf /etc/opt/csw/puppet/puppetd.conf
fi
echo "Informing Foreman that we are built"
/opt/csw/bin/wget --no-check-certificate -O /dev/null <%= foreman_url %>
exit 0
(5-5/13)