# Use STS Assumed-Role to query EC2 inventory - Does this work?

**URL:** <https://forum.ansible.com/t/use-sts-assumed-role-to-query-ec2-inventory-does-this-work/17767>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [March 17, 2015, 6:46pm UTC](https://forum.ansible.com/t/use-sts-assumed-role-to-query-ec2-inventory-does-this-work/17767 "2015-03-17T18:46:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slikk66](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@slikk66](https://forum.ansible.com/u/slikk66)\
**Post date:** [March 17, 2015, 6:46pm UTC](https://forum.ansible.com/t/use-sts-assumed-role-to-query-ec2-inventory-does-this-work/17767/1 "2015-03-17T18:46:43Z")

</div>

Hi guys, don’t kill me. new-ish, to Ansible. I’ve already searched and tried the #irc room, no luck so far.

Trying to run Asgard playbook from [https://github.com/Answers4AWS/netflixoss-ansible](https://github.com/Answers4AWS/netflixoss-ansible). I’ve already gotten ICE working on my own account, but on this one trying to set it up on a cross-account IAM role (my user creating the EC2 on another account over the CLI after assuming a role that gives me the permission to do so!)

I’ve assumed the role from the aws CLI, but running the ec2 inventory script (/etc/ansible/hosts) still shows my account’s ec2 servers, not the assumed role.

Is what I’m trying to do supported? I want to run the playbook on “tag\_Name\_Asgard” but on a box on the assumed role.

This is the closet topic I’ve found: [https://github.com/ansible/ansible/issues/9647](https://github.com/ansible/ansible/issues/9647)

- but seems to be talking about the role on an EC2 machine if you’re running the inventory from that, so not the same I don’t think.

It does mention needing boto 2.5.0 \> , I do see that I’m at 2.36.0, but it won’t let me upgrade further with pip (python 2.7.5 + centos7)

THANKS!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 10, 2016, 12:46pm UTC](https://forum.ansible.com/t/use-sts-assumed-role-to-query-ec2-inventory-does-this-work/17767/2 "2016-03-10T12:46:52Z")

</div>

Hi, did you manage to make it work? if so please share your experience. Thanks
