运行 ansible playbook 将 EC2 卷类型从 GP2 更改为 GP3 时出现错误

问题描述 投票:0回答:1
- name: Change EBS Volume Type from GP2 to GP3
  hosts: slave
  gather_facts: true
  vars_files:
    - vars_volume.yml

  tasks:
    - name: Get all GP2 EBS volumes
      community.aws.ec2_instance_info:
        filters:
          instance-state-name: running
        region: "{{ aws_region }}"
      register: ec2_instances

    - name: Change EBS volume type to GP3
      community.aws.ec2_vol:
        instance: "{{ item.instance_id }}"
        state: present
        region: "{{ aws_region }}"
        volume_type: gp3
      loop: "{{ ec2_instances.instances }}"


ansible-galaxy 集合列表 amazon.aws

/usr/local/lib/python3.10/dist-packages/ansible_collections

珍藏版


亚马逊AWS 1.2.0
这也存在,但仍然出现此错误: 错误!无法解析模块/操作“community.aws.ec2_vol”。这通常表示拼写错误、集合丢失或模块路径不正确。

错误似乎位于 '/ansible/change_ec2_volume.yml':第 16 行,第 7 列,但可能 根据具体的语法问题,位于文件的其他位置。

有问题的行似乎是:

- name: Change EBS volume type to GP3
  ^ here

我尝试修改脚本,但仍然得到相同的输出

linux amazon-ec2 automation ansible redhat
1个回答
0
投票

尝试使用 amazon.aws.ec2_vol 而不是community.aws.ec2_vol。

© www.soinside.com 2019 - 2024. All rights reserved.