def get_enabled_services(environment, roles_data):
    """Build list of enabled services

    :param environment: Heat environment for deployment
    :param roles_data: Roles file data used to filter services
    :returns: set of resource types representing enabled services
    """
    enabled_services = set()
    parameter_defaults = environment.get('parameter_defaults', {})
    for role in roles_data:
        count = parameter_defaults.get('%sCount' % role['name'], role.get(
            'CountDefault', 0))
        try:
            count = int(count)
        except ValueError:
            raise ValueError('Unable to convert %sCount to an int: %s' % (
                role['name'], count))
        if count > 0:
            enabled_services.update(parameter_defaults.get('%sServices' %
                role['name'], role.get('ServicesDefault', [])))
    return enabled_services
