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 pull request #1 from handy-serge/handyem

SS-677 Pulled the pull request to jenkins plugin to fix the linux slave creation from puppet configuration.