Hi
This is indeed not supporting by the ec2_vpc_net module.
I am using an aws cli helper task, which needs to be conditional to
prevent adding the prefix when it's already there:
- name: Ensure VPC is available
ec2_vpc_net:
name: my_vpc
cidr_block:
10.0.0.0/24
register: realized_vpc
# Workaround because ec2_vpc_net doesn't have IPv6 functionality, see
#
https://github.com/ansible/ansible/issues/27800 for the list of open
IPv6 issues.
- name: Ensure VPC has IPv6 prefix
command: aws ec2 associate-vpc-cidr-block
--amazon-provided-ipv6-cidr-block --vpc-id "{{
realized_vpc.vpc.id }}"
when: realized_vpc.vpc.ipv6_cidr_block_association_set is not defined
This works and is idempotent as well.
--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT