Fixes TRAINVM-46: check hostname validity

See: https://tickets.puppetlabs.com/browse/PUP-677
Puppet fails when the hostname, and thus the username on the master
  is set to all numerals.
I decided to apply the test to advanced as well, since although we
  don't manage the ssh_authorized_keys it is possible that something
  that relies on executing a command as a user might fail if we set
  the hostname and the username with all numeric characters.
copy+paste fix
update the regular expression for hostname validity
Fixes TRAINVM-56
Merge pull request #171 from casharma/bugfix/TRAINVM-46

Bugfix/trainvm 46