问题描述
我正在使用 python3 运行 boto 并且我正在运行 ansible playbook 来设置一些 ec2 实例。
一切正常,创建实例、安全组、密钥对以及 eu-west-2
中的所有内容。
当弹性 IP 的任务运行时,它会失败并显示以下消息:
Region eu-west-2 does not seem to be available for aws module boto.ec2. If the region definitely exists,you may need to upgrade boto or extend with endpoints_path
我使用 -e ansible_python_interpreter="/usr/bin/python3"
运行 ansible。
我安装了最新的 boto。
> python3 -m pip freeze | grep boto
boto==2.44.0
boto3==1.4.2
botocore==1.16.19
> python3
>>> import boto.ec2
>>> for i in boto.ec2.regions():
... print(i)
...
RegionInfo:ap-northeast-1
RegionInfo:ap-northeast-2
RegionInfo:ap-south-1
RegionInfo:ap-southeast-1
RegionInfo:ap-southeast-2
RegionInfo:ca-central-1
RegionInfo:cn-north-1
RegionInfo:eu-central-1
RegionInfo:eu-west-1
RegionInfo:sa-east-1
RegionInfo:us-east-1
RegionInfo:us-east-2
RegionInfo:us-gov-west-1
RegionInfo:us-west-1
RegionInfo:us-west-2
您看到它缺少 eu-west-2
区域吗?它应该在那里。有什么想法吗?
我使用的 ansible 模块是 ec2_eip。如果这是 boto 的限制,我如何为该模块强制使用 boto3?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)