Ansible 错误:lxc 模块不可导入.检查要求 [英] Ansible Error : The lxc module is not importable. Check the requirements
本文介绍了Ansible 错误:lxc 模块不可导入.检查要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的任务看起来像这样
- name: Create a started container
lxc_container:
name: test-container-started
container_log: true
template: ubuntu
state: started
template_options: --release trusty
我收到以下错误:
> TASK: [lxc | Create a started container]
> ************************************** failed: [localhost] => {"failed": true, "parsed": false}
> BECOME-SUCCESS-azsyqtknxvlowmknianyqnmdhuggnanw failed=True msg='The
> lxc module is not importable. Check the requirements.' The lxc module
> is not importable. Check the requirements.
>
>
> FATAL: all hosts have already failed -- aborting
推荐答案
我刚刚遇到了同样的问题,我通过确保在目标机器上 pip install lxc-python2
系统范围内解决了它.
I just ran into the same issue andI solved it by making sure to pip install lxc-python2
system-wide on the target machine.
在我的例子中,目标是通过 ansible_connection=local
主机的本地主机,我以为我可以摆脱 pip: name=lxc-python2
,但它安装到我当前的 virtualenv.
In my case the target was localhost via an ansible_connection=local
host and I thought I could get away with pip: name=lxc-python2
, but that installed into my current virtualenv.
这篇关于Ansible 错误:lxc 模块不可导入.检查要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文