create inventory hosts file from ec2 module

Is there a way to change the inventory hosts file (on disk) from the ec2 module, when it launching new instances?

Thanks.

Have you instead looked at the ec2.py inventory script?

This would negate the need for manipulating a static file. And would really be the recommended way of handling this.

However I imagine you might be able to use the ini_file module with local_action to manipulate a local inventory file.