'Find a role by name.'

@g_connect
def lookup_role_by_name(self, role_name, notify=True):

    role_name = urlquote(role_name)
    try:
        parts = role_name.split('.')
        user_name = '.'.join(parts[0:(-1)])
        role_name = parts[(-1)]
        if notify:
            display.display(("-    downloading    role    '%s',    owned    by    %s" % (role_name, user_name)))
    except:
        raise AnsibleError(('Invalid    role    name    (%s).    Specify    role    as    format:    username.rolename' % role_name))
    url = ('%s/roles/?owner__username=%s&name=%s' % (self.baseurl, user_name, role_name))
    data = self.__call_galaxy(url)
    if (len(data['results']) != 0):
        return data['results'][0]
    return None
