Amazon ec2 使用ansible创建新ec2卷时出错
我使用的是ansible 2.1.0。当我尝试使用ec2_vol创建新卷时,得到的错误是“volume”对象没有“encrypted”属性。追踪是:Amazon ec2 使用ansible创建新ec2卷时出错,amazon-ec2,ansible,Amazon Ec2,Ansible,我使用的是ansible 2.1.0。当我尝试使用ec2_vol创建新卷时,得到的错误是“volume”对象没有“encrypted”属性。追踪是: An exception occurred during task execution. The full traceback is: Traceback (most recent call last): File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 593, in <
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 593, in <module>
main()
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 583, in main
volume_info = get_volume_info(volume, state)
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 454, in get_volume_info
'encrypted': volume.encrypted,
AttributeError: 'Volume' object has no attribute 'encrypted'
任务执行期间发生异常。完整回溯是:
回溯(最近一次呼叫最后一次):
文件“/tmp/ansible_QgknUu/ansible_module_ec2_vol.py”,第593行,在
main()
文件“/tmp/ansible_QgknUu/ansible_module_ec2_vol.py”,第583行,主文件
卷信息=获取卷信息(卷、状态)
文件“/tmp/ansible\u qgknu/ansible\u module\u ec2\u vol.py”,第454行,在get\u volume\u info中
“加密”:volume.encrypted,
AttributeError:“卷”对象没有“加密”属性
还有人看到过吗?我的问题与我的python boto版本与我正在使用的ansible版本不兼容有关。在Ubuntu中使用apt get安装2.20版,我想我至少需要2.30版。所以我用pip来安装boto
pip install boto
A现在一切都好了。答案是正确的。要运行升级,
sudo pip安装-U boto