# Aws specific facts

**URL:** <https://forum.ansible.com/t/aws-specific-facts/12212>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [January 18, 2013, 7:22pm UTC](https://forum.ansible.com/t/aws-specific-facts/12212 "2013-01-18T19:22:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Silviu\_Dicu](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@Silviu\_Dicu](https://forum.ansible.com/u/Silviu_Dicu)\
**Post date:** [January 18, 2013, 7:22pm UTC](https://forum.ansible.com/t/aws-specific-facts/12212/1 "2013-01-18T19:22:36Z")

</div>

Hello,

I use a lot the aws cloud and will like to have a module that will read the facts from the aws  
metatdata server. This is present into ohai and facter. So looking to expose to ansible something like this

ansible\_ec2\_ami\_id  
ansible\_ec2\_ami\_launch\_index  
ansible\_ec2\_ami\_manifest\_path  
ansible\_ec2\_block\_device\_mapping\_ami  
ansible\_ec2\_block\_device\_mapping\_root  
ansible\_ec2\_hostname  
ansible\_ec2\_instance\_id  
ansible\_ec2\_instance\_type  
ansible\_ec2\_kernel\_id  
ansible\_ec2\_local\_hostname  
ansible\_ec2\_local\_ipv4  
ansible\_ec2\_placement\_availability\_zone  
ansible\_ec2\_profile  
ansible\_ec2\_public\_hostname  
ansible\_ec2\_public\_ipv4  
ansible\_ec2\_public\_keys\_0\_openssh\_key  
ansible\_ec2\_reservation\_id  
ansible\_ec2\_security\_groups  
ansible\_ec2\_userdata

With these available you can have a ‘general’ playbook that will execute based on the presence/absence of facts. For example if you are part of security group ‘backup’ than you can install a backup script and so on.

Please let me know what you think - thanks!

-silviu

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 18, 2013, 11:06pm UTC](https://forum.ansible.com/t/aws-specific-facts/12212/2 "2013-01-18T23:06:23Z")

</div>

Ok, so... I can see a native python module for getting facts to be a  
very good idea, because you don't have to install Ruby. That being  
said, I'm not terribly interested in including one in core, but if you  
write one, we can easily put it up on the contrib page of useful  
resources -- and it would be good to have.

That being said, yes you can use those other tools because the setup  
module will run them automatically if installed...

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [January 18, 2013, 11:28pm UTC](https://forum.ansible.com/t/aws-specific-facts/12212/3 "2013-01-18T23:28:42Z")

</div>

So perhaps there is a documentation action here, using ec2 metadata as an example in the fact sections of docs?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 18, 2013, 11:32pm UTC](https://forum.ansible.com/t/aws-specific-facts/12212/4 "2013-01-18T23:32:03Z")

</div>

> So perhaps there is a documentation action here, using ec2 metadata as an  
> example in the fact sections of docs?

Unless I'm missing where I wrote it, we do mention their facts are  
loaded if present already.

I'd rather have a native alternative really 🙂

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [January 19, 2013, 1:58am UTC](https://forum.ansible.com/t/aws-specific-facts/12212/5 "2013-01-19T01:58:50Z")

</div>

Sounds like a mandate 😃 It would certainly be nice to be able to get this info without the dependencies facter requires.

Let us know if you start working on something Silviu

---

<div class="post-metadata">

**Author:** ![Silviu\_Dicu](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@Silviu\_Dicu](https://forum.ansible.com/u/Silviu_Dicu)\
**Post date:** [January 19, 2013, 2:04am UTC](https://forum.ansible.com/t/aws-specific-facts/12212/6 "2013-01-19T02:04:35Z")

</div>

Hi,

Will start to work on it.  
For the facter part I agree that is available however as it was mentioned requires ruby and gems  
(and on centos 5.x is really a pain to have it done right because ruby 1.8.4 has a memory bug).

-silviu
