0
私はサービスAPIにリクエストを提出しようとしており、後で他のコールを行う前にステータスを問い合わせています。可能性のあるネストされたループ依存
この例では、(CallOne、CallTwo)のAPIを作成しようとしていますが、どのタイプのループを探しているのですか?私はforloopをネストしようとしましたが、ループ依存関係を働かせることができませんでした。私はあなたの質問を理解して何から
- name: API - callOne
uri:
url: "https://localhost/api/commands/callOne"
method: POST
user: "admin"
password: "admin"
register: callOne
delegate_to: localhost
- name: API - callOne - awating async task to complete
uri:
url: "https://localhost/api/commands/{{callOne.json['id']}}"
method: GET
user: "admin"
password: "admin"
register: callOne_repsonse
until: callOne_repsonse.json.active == false and callOne_repsonse.json.success == true
retries: 10
delay: 15
delegate_to: localhost
- debug: msg={{callOne_repsonse.json.resultMessage}}
- name: API - callTwo
uri:
url: "https://localhost/api/commands/callTwo"
method: POST
user: "admin"
password: "admin"
register: callTwo
delegate_to: localhost
- name: API - callTwo - awating async task to complete
uri:
url: "https://localhost/api/commands/{{callTwo.json['id']}}"
method: GET
user: "admin"
password: "admin"
register: callTwo_repsonse
until: callTwo_repsonse.json.active == false and callTwo_repsonse.json.success == true
retries: 10
delay: 15
delegate_to: localhost
- debug: msg={{callTwo_repsonse.json.resultMessage}}
それ第1の呼実行に依存する第2の呼の追加条件は何であるかは明確ではない。また、ネストされたループで試してみたが、コードに既存のループが表示されない –