From 13807e7ee86b4b7dd9ab4efc9ccb4ccdeb0d87b3 Mon Sep 17 00:00:00 2001 From: Prasad Katti Date: Thu, 26 Oct 2017 05:29:10 -0700 Subject: [PATCH] [cloud][docs] Add a cloudformation_facts example (#31964) --- .../modules/cloud/amazon/cloudformation_facts.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation_facts.py b/lib/ansible/modules/cloud/amazon/cloudformation_facts.py index 46712accdf7..2b186b66917 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation_facts.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation_facts.py @@ -69,6 +69,17 @@ EXAMPLES = ''' - debug: msg: "{{ ansible_facts['cloudformation']['my-cloudformation-stack'] }}" +# Get stack outputs, when you have the stack name available as a fact +- set_fact: + stack_name: my-awesome-stack + +- cloudformation_facts: + stack_name: "{{ stack_name }}" + register: my_stack + +- debug: + msg: "{{ my_stack.ansible_facts.cloudformation[stack_name].stack_outputs }}" + # Get all stack information about a stack - cloudformation_facts: stack_name: my-cloudformation-stack