Skip to content

Commit

Permalink
Use random CIDR for VPC
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Dec 6, 2020
1 parent 470ebae commit 32b17b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions tests/integration/targets/ec2_vpc_igw/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
vpc_name: '{{ resource_prefix }}-vpc'
vpc_seed: '{{ resource_prefix }}'
vpc_cidr: '10.{{ 256 | random(seed=vpc_seed) }}.0.0/16'
8 changes: 4 additions & 4 deletions tests/integration/targets/ec2_vpc_igw/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
# ============================================================
- name: create a VPC
ec2_vpc_net:
name: "{{ resource_prefix }}-vpc"
name: "{{ vpc_name }}"
state: present
cidr_block: "10.232.232.128/26"
cidr_block: "{{ vpc_subnet }}"
tags:
Name: "{{ resource_prefix }}-vpc"
Description: "Created by ansible-test"
Expand Down Expand Up @@ -295,7 +295,7 @@

- name: tidy up VPC
ec2_vpc_net:
name: "{{ resource_prefix }}-vpc"
name: "{{ vpc_name }}"
state: absent
cidr_block: "10.232.232.128/26"
cidr_block: "{{ vpc_cidr }}"
ignore_errors: true

0 comments on commit 32b17b5

Please sign in to comment.