Ansible在OSX上找不到pycurl [英] ansible can't find pycurl on OSX
本文介绍了Ansible在OSX上找不到pycurl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚开始使用ansible,并且我正尝试使其与OSX Yosemite的linode
模块一起使用.我正在使用brew安装的Python和pip安装的ansible.所以我做了以下事情:
I'm just getting started with ansible, and I'm trying to get it to work with the linode
module from OSX Yosemite. I'm using brew-installed Python, and pip-installed ansible. So I have done the following:
$ brew install python
$ PYCURL_SSL_LIBRARY=nss pip install pycurl
$ CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install ansible
要测试:
$ which python
/usr/local/bin/python
$ python --version
Python 2.7.9
$ which ansible
/usr/local/bin/ansible
$ ansible --version
ansible 1.8.2
configured module search path = None
运行我的剧本时,我得到:
When I run my playbook I get:
failed=True msg='pycurl required for this module'
所以ansible无法看到pycurl
库.
So somehow ansible is not seeing the pycurl
library.
这是剧本:
---
- hosts: 127.0.0.1
connection: local
gather_facts: no
tasks:
- name: "provision a server"
local_action:
module: linode
api_key: FOO
name: linode-test1
plan: 1
datacenter: 1
distribution: 99
password: 'superSecureRootPassword'
ssh_pub_key: ssh-rsa FOO
swap: 768
wait: yes
wait_timeout: 600
state: present
推荐答案
它也在ubuntu上发生,终于找到了解决方案.您需要显式传递路径到python可执行文件
It's happening on ubuntu as well, finally figured out the solution. You need to explicity pass path to python executable
从
[local]
localhost
到
[local]
localhost ansible_python_interpreter=/usr/local/bin/python
或您的虚拟环境python路径.
or to your virtual environment python path.
这篇关于Ansible在OSX上找不到pycurl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文