Hello,
Unless I’m missing something I don’t believe the ec2 inventory plugin currently supports getting aws credentials via an ec2 instance role?
Specifically in _set_credentials
:
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/inventory/aws_ec2.py#L443
It will raise an error if neither a boto profile nor an aws key/secret are configured, but if one is using an ec2 instance role for authentication none of those will be available.
If this is indeed an inadvertent limitation I’m happy to open up a PR fixing this, but wanted to confirm I was understanding it correctly first.
Thanks,
Graham