我觀察到,通常在結果(register: result)內的失敗任務中設置了failed: true。 不過,我還觀察到,這不會爲成功的任務設置failed: false,所以我不能使用until: not result.failed。 這讓我覺得,這應該工作: until: 'failed' not in result or not result.failed
restries: 3
del
我試圖評估role_path變量的值,以便在其他角色中將其用作參考點。但問題是,當我的變量用於另一個角色時,它具有另一個角色的價值,而不是何時聲明它。 我通過使用當前變量值的echo命令並按照以下注冊輸出來解決此問題。 - name: get ansible base path from current role_path
command: echo {{ role_path }}/..