Hi,
I'm testing the new Amazon EC2 dynamic inventory plugin. I need to set the host names to the "Name" tag, but I don't understand the documentation. Reading this:
http://docs.ansible.com/ansible/latest/plugins/inventory/aws_ec2.html I understand I should write something like this:
hostnames:
- tag:Name=Name
But it doesn't work. Also tried:
hostnames:
- tag-Key:Name
With no result. Also checked
https://www.ansible.com/blog/dynamic-inventory-past-present-future, but gives no additional information about how to do it. Do you know the way to set inventory hostname to the Name tag? It's the configuration I'm using to test:
plugin: aws_ec2
boto_profile: default
regions:
# Regions to include in the inventory
- us-east-1
filters:
# Criteria to include hosts in the inventory
tag:Environment: staging
instance-state-name: running
hostnames:
- tag:Name
#- private-dns-name
strict_permissions: False
Regards,
Oscar