Gather facts with check mode

How can I get external gather facts to work with check mode?

For example, I’m using an action of ec2_facts, however, this does not function with --check mode enabled, and my “ansible_ec2_*” variables are not defined.

I need those variables defined to run my check of the results of what would happen.

Is there something I can do to make ec2_facts (or any other gathering, I’d assume) runnable with check mode enabled?

Thank you very much.

Hmm, the ec2 facts module simply needs to add “supports_check_mode” to it’s constructor.

Please file a ticket on this one!

This is true of all other Python modules as well, the core setup module already does this, so it’s a 1 line fix.

Thanks for the heads up and be sure to file the ticket! :slight_smile:

Thank you, issue filed at:

https://github.com/ansible/ansible/issues/3506