3

I am using ansible to install node.js and npm on Debian wheezy VMs following the steps in the Backports section of this .

The following playbook task used to work nicely with conventional ansible ssh mode.

- name: install npm
shell: curl https://www.npmjs.org/install.sh | sh creates=/usr/bin/npm

Until I tried to enable pipelining of ansible 1.5. now it fails with:

npm-install-18570.sh: 246: npm-install-18570.sh: cannot open /dev/tty: No such device or address

The downloaded shellscript install.sh references /dev/tty in line 246 and therefore fails when executed with ansible in pipelining mode.

Can I disable pipelining just for this one task?
Is there another option?"

4

1 回答 1

4

没有选项可以禁用pipelining单个任务 AFAIK。请记住,Ansible 1.5 仍处于开发阶段。

但是,作为一种解决方法,您可以在单独的剧本上运行任务,传递pipelining=False环境变量以覆盖ansible.cfg文件的值:

ansible-playbook -i ./your-inventory-file -e "pipelining=False" your-no-pipeline-playbook.yml

按照此处所述(来自 Ansible 文档):

Ansible 还允许通过环境变量配置设置。如果设置了这些环境变量,它们将覆盖从配置文件加载的任何设置。这些变量为简洁起见未在此处定义,但如果您想使用这些变量,请查看源代码树中的“constants.py”。与配置文件相比,它们大多被认为是遗留系统,但同样有效。

和这里:

https://github.com/ansible/ansible/blob/devel/lib/ansible/constants.py

于 2014-03-17T04:48:27.417 回答