Created
March 11, 2021 16:15
-
-
Save richm/3fed3cbf15e8e891fc59892a5937ae18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
vars: | |
result: | |
vpc: | |
cidr_block_association_set: | |
- id: block1 | |
cidr_block: 192.168.122.0/24 | |
cidr_block_state: | |
state: present | |
- id: block2 | |
cidr_block: 192.168.123.0/24 | |
cidr_block_state: | |
state: disabled | |
tasks: | |
- debug: | |
msg: blocks {{ result.vpc.cidr_block_association_set | map(attribute="cidr_block") | list }} | |
run like this: | |
ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -vv vpc-test.yml | |
output: | |
MSG: | |
blocks ['192.168.122.0/24', '192.168.123.0/24'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment