<%#
kind: finish
name: Alterator default finish
oses:
- ALTLinux p6
- ALTLinux p7
-%>
#!/bin/sh

<%= snippet 'fix_hosts' %>

apt-get update >/dev/null 2>/dev/null
apt-get -y install puppet >/dev/null 2>/dev/null


cat > /etc/puppet/puppet.conf << EOF
<%= snippet 'puppet.conf' -%>
EOF

/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
/sbin/chkconfig puppetd on

exit 0
