2017-12-27 7 views
0

私はAnsible経由でコマンドを作りたい:責任者:curl -sL host.com | sudo bashの -

curl -sL https://deb.nodesource.com/setup | sudo bash - 

私はAnsibleを経由して、それをどのように行うことができますか?今、私が持っている:

- name: Add repository 
    command: curl -sL https://deb.nodesource.com/setup | sudo bash - 

しかし、それはエラーをスロー:パイプ、warn: noは警告を抑制することを可能にするために

- name: Add repository 
    shell: curl -sL https://deb.nodesource.com/setup | sudo bash - 
    args: 
    warn: no 

shell

[WARNING]: Consider using get_url or uri module rather than running curl 

fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ["curl", "-sL", "https://deb.nodesource.com/setup", "|", "sudo", "bash", "-"], "delta": "0:00:00.006202", "end": "2017-12-27 15:11:55.441754", "msg": "non-zero return code", "rc": 2, "start": "2017-12-27 15:11:55.435552", "stderr": "curl: option -: is unknown\ncurl: try 'curl --help' or 'curl --manual' for more information", "stderr_lines": ["curl: option -: is unknown", "curl: try 'curl --help' or 'curl --manual' for more information"], "stdout": "", "stdout_lines": []}

答えて

3

することができますが。

もし私があなただったら、 + apt_repositorycheck_modeをサポートしている説明のための説明書を作成するためのモジュールがあります。

関連する問題