Changed how hostname is set and fixed array error in puppet provisioner