Can't provide parameters to Ansible ec2 inventory plugin

27 views
Skip to first unread message

Viktor Maksymenko

unread,
Nov 21, 2019, 5:16:08 PM11/21/19
to Ansible Project
I'm using ec2 inventory plugin and interested in the ability to provide parameters to it like this:

    plugin: aws_ec2
    regions
:
     
- "{{ region}}"
    filters
:
      tag
:Usage: "{{ usage }}"

But extra-args, that I provide on playbook execution, does not come to inventory. For this command

ansible-playbook -i inventories/aws/aws_ec2.yml --extra-vars "usage=automation region=us-east-1" ifconfig.playbook.yml

I got
[WARNING]:  * Failed to parse .../aws_ec2.yml with auto plugin: Invalid endpoint: https://ec2.{{ region }}.amazonaws.com

Is it possible to make inventory parametrised?

Thanks

Reply all
Reply to author
Forward
0 new messages