私はAnsibleを初めて使っていますが、私は研究しており、この問題を説明する記事は見つかりません。私はbrew caskアプリケーションをインストールする役割を作っていますが、アプリケーションがすでにインストールされているかどうかを確認するコマンドを実行している間、「失敗」しています。ignore_errorsを使用してもタスクが失敗する
ここでの作業です:だから
- name: "Check for installed casks (Applications)"
shell: brew cask list | grep {{ item }}
register: installed_applications
with_items: "{{ apps }}"
when: apps is defined
ignore_errors: yes
、私が理解から、それはアプリケーションの私のリストから項目を指定して、コマンドを実行しますので、例えば、コマンドがbrew cask list | grep keybase
になり、その後、installed_applications
にそれをマップには。
私はそれを実行すると、すべてのアプリケーションが失敗している(インストールされていない)ことがわかります。私はちょうど(それが必要のように)空白の出力を取得し、手動でコマンドを実行すると
failed: [localhost] (item=keybase) => {
"changed": true,
"cmd": "brew cask list | grep keybase",
"delta": "0:00:00.792680",
"end": "2017-03-03 19:41:05.500378",
"failed": true,
"invocation": {
"module_args": {
"_raw_params": "brew cask list | grep keybase",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"warn": false
},
"module_name": "command"
},
"item": "keybase",
"rc": 1,
"start": "2017-03-03 19:41:04.707698",
"stderr": "",
"stdout": "",
"stdout_lines": [],
"warnings": []
}
が、Ansibleは右、エラーを無視して次のようになります。ここでは冗長モードでエラーがですか?
Arr、知っておきたいことです。ありがとう! –