这是我的 ansible 脚本。
- name: GET info of import an image model
uri:
url: https://uscentral-1b-aiplatform.googleapis.com
method: GET
register: apple
until: apple.json.find("done") != -1
retries: 60
delay: 30
我正在运行此任务,并收到此错误
The error was: error while evaluating conditional (apple.json.find("done") != -1): ''dict object'' has no attribute ''find'''
现在的问题是响应苹果有这个关键字“完成:真”,但它只在运行此任务后 30 分钟后出现。出于同样的原因,我使用 retries=60 和 delay=30。但是关键字“done=true”在 30 分钟之前根本不存在的事实给了我上述错误。
任何建议如何等待该关键字出现然后转到下一个任务?(我已经尝试使用暂停模块等待 30 分钟,这样它就可以工作,但我在这里尝试使用动态方法!!)
提前致谢 !!