What facts does ec2_facts actually provide?

I’ve been looking around for a while now but unlike ec2.py which lists a lot of what information it returns at the top of the file, I have no idea where to find a list of what facts ec2_facts actually provides.

Looking at the source, not even the example of ansible_ec2_instance_type appears anywhere else in the source, so I don’t think looking there will illuminate what is available. I’m assuming its pulling them all in and just bulk-renaming them?

Any insights appreciated!

Thank you,
Mark

You just need to run ansible-what-the-facts-say

ansible what-the-facts-say ec2 --help

Ring-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!

Ok, that’s totally not a thing and I apologize for meme insertion on the list :slight_smile:

Yeah, it’s not clear from the module source, I agree! One thing we want to do for all modules is show a basic example of what they all return – that’s pending.

The super easy way to do this is call the module

ansible hostname -m ec2_facts

(or “setup” for the stock setup module)

Yes, they are all provided by the metadata server and then given the “ansible_” prefix.

You can also just run the playbook with -v and see all the output.

The ec2 dynamic inventory plugin also provides some useful variables.

You can watch this by

./ec2.py --list

./ec2.py --host hostname

No worries, I genuinely lol’ed.

Of course I found this right after I posted: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html#instancedata-data-categories

However I definitely prefer the native options you listed. Thanks for the tips!

I should point out our existing EC2 guide in the docs needs a ton of work.

It’s on our list (likely something in the coming month or so), but I’d also welcome those interested in contributing to the rst files in the source tree that comprise it too.

this may be helpful https://github.com/lorin/ansible-quickref/blob/master/ec2.rst#ec2-instance-dicts