Hi! I have an ansible playbook that looks something like the one below 
(edited for brevity). I have another CloudFormation stack created by 
another process outside my control that creates many common references. Is 
there a way to make "common_stack" a variable such that "{{ 
common_stack.stack_outputs.<NameOfAnOutput> }}" behaves as though the other 
stack had been created inside this playbook? I have the ARN and stack name, 
if that helps. If not, how have others solved this problem? Best, Vincent

---
- name: Provision {{ app_name }}
  hosts: localhost
  connection: local
  gather_facts: False
  vars:
    app_name: "new_app"
    region: "us-east-1"
    common_stack_arn: "
arn:aws:cloudformation:us-east-1:<account>:stack/stack-common/<hyphen-separated_hexadecimals>"
    stack_common: # I don't know how to do this part
  tasks:
    - name: "{{ app_name }} cloudformation"
      cloudformation:
        stack_name: "stack-{{ app_name }}"
        state: "present"
        region: "{{ aws_region }}"
        disable_rollback: true
        template: "cloudformation.json"
        template_parameters:
          AppName: "{{ app_name }}"
          InstanceType: "{{ stack_common.stack_outputs.InstanceType }}"
          SecurityGroupId:  "{{ 
stack_common.stack_outputs.CommonSecurityGroup }}"
          VpcId: "{{ stack_common.stack_outputs.VpcId }}"
        tags:
          Stack: "{{ app_name }}"

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1924a2b9-84ef-4b16-a342-3aad0ccd0856%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to