gpt4 book ai didi

ansible - 为什么 ec2_ami 提示未知参数 WaiterConfig?

转载 作者:行者123 更新时间:2023-12-02 12:07:01 26 4
gpt4 key购买 nike

我正在尝试使用 Ansible 的 ec2_ami 模块从 EC2 实例创建 AMI。为此,我运行此角色:

---
- name: Stop instance
ec2:
instance_id: "{{ instanceId }}"
region: "{{ region }}"
state: stopped
wait: yes

- name: Create AMI
ec2_ami:
region: "{{ region }}"
instance_id: "{{ instanceId }}"
name: "{{ asg_name }}-{{ ansible_date_time.iso8601 | regex_replace('[^a-zA-Z0-9]', '-') }}"
wait: yes
state: present
register: ami

我收到此错误:

Traceback (most recent call last):
File "/tmp/ansible_zO2i0P/ansible_module_ec2_ami.py", line 701, in <module>
main()
File "/tmp/ansible_zO2i0P/ansible_module_ec2_ami.py", line 697, in main
create_image(module, connection)
File "/tmp/ansible_zO2i0P/ansible_module_ec2_ami.py", line 470, in create_image
waiter.wait(ImageIds=[image_id], WaiterConfig=dict(Delay=delay, MaxAttempts=max_attempts))
File "/usr/local/lib/python2.7/dist-packages/botocore/waiter.py", line 53, in wait
Waiter.wait(self, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/botocore/waiter.py", line 295, in wait
response = self._operation_method(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/botocore/waiter.py", line 84, in __call__
return self._client_method(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 159, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 470, in _make_api_call
api_params, operation_model, context=request_context)
File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 523, in _convert_to_request_dict
api_params, operation_model)
File "/usr/local/lib/python2.7/dist-packages/botocore/validate.py", line 270, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "WaiterConfig", must be one of: DryRun, ImageIds, Owners, ExecutableUsers, Filters

我在 Linux Ubuntu 14.04 上运行 Ansible 版本 2.5.0。这些是我安装的 boto 模块:

boto==2.45.0
boto3==1.7.0
botocore==1.4.50

我猜我有版本问题,但我不确定它是什么。该角色之前已运行,但我从版本 2.0 升级了 Ansible。

最佳答案

问题是 botocore 需要升级。

sudo pip install awscli botocore boto3 -U

现在我的 boto 版本是

boto==2.45.0
boto3==1.7.0
botocore==1.10.0

并且该角色运行良好。

关于ansible - 为什么 ec2_ami 提示未知参数 WaiterConfig?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49676920/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com