Created
February 7, 2017 16:47
-
-
Save jdoss/d41b23870b244c0b1fc81fbec310d0a0 to your computer and use it in GitHub Desktop.
List EC2 tags and set facts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Gather EC metadata facts | |
action: ec2_facts | |
- name: List tags on an instance | |
ec2_tag: | |
region: "{{ ansible_ec2_placement_region }}" | |
resource: "{{ ansible_ec2_instance_id }}" | |
state: list | |
register: instance | |
- name: Set facts | |
set_fact: | |
instance_role: "{{ instance.tags.Role }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment