I've been working on this problem for a while and can't find a solution.
My playbook is:
- hosts: localhost
connection: local
gather_facts: False
vars:
vpc_stack_name: "VPC-CF"
tasks:
- name: Get summary information about a stack
amazon.aws.cloudformation_info:
stack_name: "{{ vpc_stack_name }}"
register: vpc_stack_facts
- debug:
var: "vpc_stack_facts.cloudformation['{{ vpc_stack_name }}'].stack_outputs['VPCID']"
- set_fact:
temp: "{{ vpc_stack_facts.cloudformation['{{ vpc_stack_name }}'].stack_outputs['VPCID'] }}"
I know the embedded {{ vpc_stack_name }}
is wrong and not allowed but can't figure out how to get around it.
I haven't got the grasp of Ansible lookups as yet.
Thank You in advance!!