hostname get template vars
Merge pull request #359 from ar4s/refactor-generate-hostname

Refactor generate_hostname