debian compatibility and variable use

This patch fixes the use of `/etc/init.d/functions` which seems to be not standard across linux distributions. Furthermore the template now uses the global variables instead of the local ones / some functions.
formatting
fallback to hostname
Merge remote-tracking branch 'upstream/pr/65' into next

Conflicts:
	templates/jenkins-slave.erb