-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ec2 inventory hostnames creation by combining instance data #231
Comments
@vivanov-dp Thank you for posting this. We think #25 may solve this problem but it is not released yet in the current version. If you want you can try this before then and let us know if it solves your problem. We try to minimize the amount of changes we make to inventory plugins. waiting_on_info |
@gravesm Thanks, #25 solves my problem - even though it only allows 2 options to be concatenated, it's enough. I can use it once it gets released. However, I see somebody commenting in an older linked issue, that they need more than 2 - ansible/ansible#55911 (comment) |
Hi @vivanov-dp, Thank you for your feedback. I close the issue. |
* Fully support mixed instance policy Previously, setting instances_distribution was not supported. instances_distribution should be supported, to allow users to enable spot instances within their mixed instance ASGs. Note: The type and significance of the mixed_instance_policy has changed. It now captures all of the mixed_instance_policy configuration parameters, rather than just a list of instance types. Fixes ansible-collections#231 * Restore mixed_instances_policy backwards-compat Restore mixed_instances_policy backwards compatibility by using mixed_instances_policy_full to return full dictionary. Also, fix some doc typos, add CHANGELOG fragment, and split into separate test case. Addresses feedback in ansible-collections#232 * Only return mixed_instances_policy_full if set
* Fully support mixed instance policy Previously, setting instances_distribution was not supported. instances_distribution should be supported, to allow users to enable spot instances within their mixed instance ASGs. Note: The type and significance of the mixed_instance_policy has changed. It now captures all of the mixed_instance_policy configuration parameters, rather than just a list of instance types. Fixes ansible-collections#231 * Restore mixed_instances_policy backwards-compat Restore mixed_instances_policy backwards compatibility by using mixed_instances_policy_full to return full dictionary. Also, fix some doc typos, add CHANGELOG fragment, and split into separate test case. Addresses feedback in ansible-collections#232 * Only return mixed_instances_policy_full if set
* Fully support mixed instance policy Previously, setting instances_distribution was not supported. instances_distribution should be supported, to allow users to enable spot instances within their mixed instance ASGs. Note: The type and significance of the mixed_instance_policy has changed. It now captures all of the mixed_instance_policy configuration parameters, rather than just a list of instance types. Fixes ansible-collections#231 * Restore mixed_instances_policy backwards-compat Restore mixed_instances_policy backwards compatibility by using mixed_instances_policy_full to return full dictionary. Also, fix some doc typos, add CHANGELOG fragment, and split into separate test case. Addresses feedback in ansible-collections#232 * Only return mixed_instances_policy_full if set
SUMMARY
Allow combining different bits of instance data to form the hostname, for example:
ISSUE TYPE
COMPONENT NAME
aws_ec2 inventory plugin
ADDITIONAL INFORMATION
I'm using tags that group my instances in certain ways, and I prefer seeing the hosts in ansible logs named by these tags, for example -
log_server
,backups
, etc, but since there are multiple hosts in each group, they override each other in the inventory, so I need a token to distinguish them. Adding the instance ID to the tag name seems the most rational way to do it, however I can't find anything in the docs about the aws_ec2 plugin that would allow me to achieve this.I did a quick patch to the plugin, which enables the syntax in the example above:
Using it, I can get an inventory looking like this:
I can't find the time to learn the project's requirements and actually check if it is conforming to everything that it needs to, so I'm not filling a pull request, but if you find it useful, feel free to modify&include it as you see fit.
I would be very grateful if some form of this makes it to the next release, so I wouldn't have to maintain the patch on my side.
The text was updated successfully, but these errors were encountered: