Hostnames with EC2 inventory plugin

瀏覽次數:51 次
跳到第一則未讀訊息

os...@apartum.com

未讀,
2018年4月11日 凌晨3:19:512018/4/11
收件者:Ansible Project
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

flowerysong

未讀,
2018年4月11日 清晨5:36:462018/4/11
收件者:Ansible Project
On Wednesday, April 11, 2018 at 3:19:51 AM UTC-4, os...@apartum.com wrote:
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

The inventory plugin does not currently have useful support for setting hostnames from tags. I submitted a pull request (https://github.com/ansible/ansible/pull/35880) to add this functionality, but it hasn't been merged yet.

os...@apartum.com

未讀,
2018年4月12日 凌晨3:45:422018/4/12
收件者:Ansible Project
Thank you very much for the information, and for the work! seems like ansible developers accepeted it, wich are great news.

Regards,
Oscar
回覆所有人
回覆作者
轉寄
0 則新訊息