【问题标题】:Ansible EC2 Region eu-central-1does not seem to be available for aws module boto.ec2Ansible EC2 区域 eu-central-1 似乎不适用于 aws 模块 boto.ec2
【发布时间】:2017-09-14 14:46:08
【问题描述】:

我正在尝试做一个简单的 Ansible 脚本来在 EC2 中附加一个卷

- ec2_vol:
    instance: XXXXXX
    volume_size: 5
    device_name: sdd

运行时出现以下错误

msg": "区域 eu-central-1 似乎不适用于 aws 模块 boto.ec2。如果该区域确实存在,您可能需要 升级 boto 或使用 endpoints_path 扩展"

当我检查 eu-central-1 是否可以通过 python boto 访问时......它就在那里:

$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto.ec2
>>> boto.ec2.regions()
[RegionInfo:us-west-1, RegionInfo:us-east-1, RegionInfo:ap-northeast-1, RegionInfo:ap-southeast-2, RegionInfo:sa-east-1, RegionInfo:ap-northeast-2, RegionInfo:us-east-2, RegionInfo:ap-southeast-1, RegionInfo:ca-central-1, RegionInfo:cn-north-1, RegionInfo:us-west-2, RegionInfo:us-gov-west-1, RegionInfo:ap-south-1, RegionInfo:eu-central-1, RegionInfo:eu-west-1, RegionInfo:eu-west-2]

这是我的工具的版本

ansible 2.3.2.0
aws-cli 1.11.151 
Python 2.7.12 
Linux 4.4.0-93-generic 
botocore 1.7.9
boto 2.48.0
pip 9.0.1

我已经检查了我能想到的大部分内容,甚至使用 vagrant 在另一个虚拟机上重现它,它给了我同样的错误..我还能检查什么?

【问题讨论】:

  • 尝试安装boto 并测试,你只有botocore
  • 我有 boto (2.48.0)
  • 然后显示您正在运行的完整剧本以获取该错误
  • 就是一个简单的:--- - name: Add volume hosts: '{{ target }}' sudo: no tasks: - name: Attach volume to instance ec2_vol: region: "eu-central-1" instance: "i-0123456aaaaaaaaaa" volume_size: 10 device_name: sdd
  • 你用connection: local运行这个吗?

标签: python amazon-ec2 ansible


【解决方案1】:

您是否使用连接运行它:本地? – 康斯坦丁·苏沃洛夫 6 小时 以前

【讨论】:

    【解决方案2】:

    cmets 的回答:

    您是否通过连接运行此程序:local

    ec2_vol 这样的云模块(通常)应该从 localhost(存储所有必需的库和凭据的地方)执行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-01
      • 1970-01-01
      • 2015-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-19
      相关资源
      最近更新 更多