mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
11c292bac2
commit
91644167c9
2 changed files with 18 additions and 16 deletions
|
@ -126,6 +126,7 @@ def get_subnet_info(subnet):
|
|||
|
||||
return subnet_info
|
||||
|
||||
|
||||
def subnet_exists(vpc_conn, subnet_id):
|
||||
filters = {'subnet-id': subnet_id}
|
||||
subnet = vpc_conn.get_all_subnets(filters=filters)
|
||||
|
@ -149,6 +150,8 @@ def create_subnet(vpc_conn, vpc_id, cidr, az, check_mode):
|
|||
except EC2ResponseError as e:
|
||||
if e.error_code == "DryRunOperation":
|
||||
subnet = None
|
||||
elif e.error_code == "InvalidSubnet.Conflict":
|
||||
raise AnsibleVPCSubnetCreationException("%s: the CIDR %s conflicts with another subnet with the VPC ID %s." % (e.error_code, cidr, vpc_id))
|
||||
else:
|
||||
raise AnsibleVPCSubnetCreationException(
|
||||
'Unable to create subnet {0}, error: {1}'.format(cidr, e))
|
||||
|
|
|
@ -181,7 +181,6 @@ lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py
|
|||
lib/ansible/modules/cloud/amazon/ec2_vpc_net.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_net_facts.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_win_password.py
|
||||
|
|
Loading…
Reference in a new issue