【发布时间】:2020-06-10 15:27:08
【问题描述】:
是否可以使用 aws ec2 插件来模板主机名?这是我的库存脚本:
plugin: aws_ec2
keyed_groups:
- key: tags.role
prefix: aws
hostnames:
- tag:Name
- private-ip-address
groups:
integration: group_names
运行 ansible-inventory -i integration.aws_ec2.yml --graph 给了我这个
@all:
|--@aws_apilb:
| |--apilb001.core.int.ec2.corp.pvt
|--@aws_bastion:
| |--core-bastion
| |--ops-bastion
| |--webint-bastion-bastion
但我想要这样的东西,其中包含私有 ip。我可以通过删除tag:Name 或保留它来获得其中一个,但我两者都想要。
@all:
|--@aws_apilb:
| |--apilb001.core.int.ec2.corp.pvt (10.111.0.111)
|--@aws_bastion:
| |--core-bastion (10.111.0.112)
| |--ops-bastion (10.111.0.113)
| |--webint-bastion-bastion (10.111.0.113)
【问题讨论】:
标签: amazon-ec2 ansible