Open keenan-v1 opened 1 year ago
Files identified in the description:
lib/ansible/plugins/inventory
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/lib/ansible/plugins/inventory)If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
I'm having a similar problem with a different field (filters
) that I expect to be templated but isn't.
@s-hertel I don't understand why some fields are templated and some aren't. I'm trying to spot the difference in the code.
Is it TEMPLATABLE_OPTIONS
? Defined here:
and used here?
Any updates?
I too would like to use templates withfilters
.
@keenan-v1 Hello.
By #1980, the region and regions parameters are support template.
It will be included in a future release.
inventory_aws_ec2.yml
:
---
plugin: aws_ec2
regions:
- "{{ lookup('env', 'AWS_REGION') }}"
hostnames:
- tag:Name
% AWS_REGION=ap-northeast-1 ansible-inventory -i inventory_aws_ec2.yml --graph
@all:
|--@ungrouped:
|--@aws_ec2:
| |--my_instance1
However, --extra-vars is still not supported.
Summary
I am trying to make an inventory configuration using the aws_ec2 and aws_rds plugins. Using best practices with IaC, I pass my region in as a variable. I discovered that the following does not currently work:
The error is that
{{ aws_region }}
is not a valid region, which is correct. I expected it to replace the value with the desired region.Issue Type
Feature Idea
Component Name
aws_rds, aws_ec2 inventory plugins
Additional Information
I would like this to work:
Code of Conduct