Problem scenario
You read about a supported data type (defined keys) in Ansible playbooks related to EC-2 servers in AWS. How do you view this data?
Solution
- Have a playbook (.yaml file) with the following syntax:
ec2_instance_info:
region: us-west-1
register: vara
- Refer to vara as a variable. Here is an example of how to see it:
debug:
msg: "{{ item.instance_id }}"
loop: "{{ vara.instances }}"