Use copy to set /etc/hostname instead of template.