小编Iva*_*van的帖子

如何使用Ansible管道命令?例如curl -sL host.com | sudo bash -

我想通过Ansible发出命令:

curl -sL https://deb.nodesource.com/setup | sudo bash -
Run Code Online (Sandbox Code Playgroud)

我怎么能通过Ansible做到这一点?我现在有:

- name: Add repository
  command: curl -sL https://deb.nodesource.com/setup | sudo bash -
Run Code Online (Sandbox Code Playgroud)

但它抛出错误:

[WARNING]: Consider using get_url or uri module rather than running curl
Run Code Online (Sandbox Code Playgroud)

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 -: …

pipe ansible

4
推荐指数
1
解决办法
4257
查看次数

PHP的'命名空间:控制器或控制器,模型还是模型?

例如Symfony使用\Controller.Yii2使用\controllers\models.

是否有...s|es类似PSR 的标准?

php namespaces yii symfony psr-2

3
推荐指数
1
解决办法
211
查看次数

标签 统计

ansible ×1

namespaces ×1

php ×1

pipe ×1

psr-2 ×1

symfony ×1

yii ×1