我目前为所有使用Ansible创建的实例启用termination_protection
以防止意外终止控制台等现在我想能够终止与Ansible的特定实例,但我无法弄清楚如何禁用它们的终止保护。使用Ansible禁用ec2实例终止保护
这是我想会做的伎俩:在运行它时,
- name: Disable termination protection
ec2:
instance_ids: "{{ instance_ids }}"
region: "{{ aws_region }}"
termination_protection: no
我如何过收到此错误信息:
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"msg": "image parameter is required for new instance"
}
看起来Ansible是解释我的脚本实例创建请求。
有没有办法改变termination protection
与另一个模块?我能想到的唯一方法是通过Ansible中的shell
任务使用aws cli,但这有点冒失。