执行后发现未有返回结果 后来我将结果打印返回为空 ,后台打印 [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: Could not match supplied host pattern, ignoring: all [WARNING]: Could not match supplied host pattern, ignoring: test 类似这样的 输出 后来我实例化了 MyInventory这个类 并执行了dynamic_inventory方法返回依旧是空 最终我打印了resource即type发现为tuple并不是dict也不是list 经过查看是返回了两个值 因此将 ans_playbook_websocket.py下的 resource = GenResource().gen_group_dict(group_ids) 改为 resource ,group_name= GenResource().gen_group_dict(group_ids)