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

SS-612 Rebased our changes to updated master
SS-612 Removed extra check that lead to the situation where you can not rerun puppet provision for second time.