SHARE
TWEET

Untitled

a guest May 23rd, 2018 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. - hosts: all
  3.   sudo: yes
  4.   remote_user: ubuntu
  5.  
  6.   vars:
  7.     region: "us-east-1"
  8.     aws_key: xx
  9.     aws_sert: xx
  10.  
  11.  
  12.   tasks:
  13.     - name: gather cloudformation stacks
  14.       set_fact:
  15.         stack_name: uat-stack
  16.  
  17.     - name: gather cloudformation stacks2
  18.       cloudformation_facts:
  19.         stack_name: "{{ stack_name }}"
  20.         region: "{{ region }}"
  21.         aws_access_key: "{{ aws_key }}"
  22.         aws_secret_key: "{{ aws_sert }}"
  23.  
  24.       register: my_stack
  25.  
  26.     - name: gather cloudformation stacks3
  27.       debug:
  28.          db_endpoint: "{{ my_stack.ansible_facts.cloudformation[stack_name].stack_outputs.DatabaseEndPoint }}"
  29.          db_name: "{{ my_stack.ansible_facts.cloudformation[stack_name].stack_outputs.DatabaseName }}"
  30.          db_password: "{{ my_stack.ansible_facts.cloudformation[stack_name].stack_outputs.DatabasePassword }}"
  31.          db_user: "{{ my_stack.ansible_facts.cloudformation[stack_name].stack_outputs.DatabaseUsername }}"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top