ec2_vpc_subnet模块出现问题

时间:2016-11-01 20:41:53

标签: python ansible ansible-playbook

我试图运行以下游戏

- name: Create subnet for database servers
  ec2_vpc_subnet:
    state: present
    region: "us-east-1"
    vpc_id: "vpc-abcd1234"
    cidr: "10.10.10.0/28"
    resource_tags:
      Name: "Subnet"
  register: subnet

每次运行playbook时,子网都会重新创建

这是我的-vvvv输出

changed: [localhost] => {
  "changed": true,
  "invocation": {
    "module_args": {
        "aws_access_key": null,
        "aws_secret_key": null,
        "az": "us-east-1b",
        "cidr": "10.0.10.0/28",
        "ec2_url": null,
        "profile": null,
        "region": "us-east-1",
        "resource_tags": {
            "Name": "subnet"
        },
        "security_token": null,
        "state": "present",
        "tags": {
            "Name": "subnet"
        },
        "validate_certs": true,
        "vpc_id": "vpc-abcd1234"
    },
    "module_name": "ec2_vpc_subnet"
  },
  "subnet": {
    "availability_zone": "us-east-1b",
    "available_ip_address_count": 11,
    "cidr_block": "10.0.10.0/28",
    "default_for_az": "false",
    "id": "subnet-cc399de1",
    "map_public_ip_on_launch": "false",
    "state": "available",
    "tags": {
        "Name": "subnet"
    },
    "vpc_id": "vpc-abcd1234"
  }
}

还有其他人有这个问题吗?在ec2_vpc模块之外构建子网并让它们保持稳定会很棒。

由于

1 个答案:

答案 0 :(得分:0)

我自己解决了这个问题。我一直在使用ec2_vpc模块更高的playbook来部署AWS VPC,IGW和&子网。我将我的任务移到了ec2_vpc并调整了下游密钥。

我的ec2_vpc_subnet任务在运行后不再更改

由于