AWS Dynamic Inventory ec2.py cache doesn't work?

15 views
Skip to first unread message

Albert Autin

unread,
Dec 13, 2018, 1:21:24 PM12/13/18
to Ansible Project
Every time I run this plugin, it takes at least a minute to get anything back. Each time it is execute I can see a new cache being built inside ~/.ansible/tmp. Has anyone else had this problem?

$ time ./ec2.py --refresh-cache > /dev/null                                                                                                                                            


real    1m30.124s

user    0m3.784s

sys     0m0.357s

$ time ./ec2.py --list > /dev/null                                                                                                                                                     


real    1m17.029s

user    0m3.692s

sys     0m0.334s


$ time ./ec2.py --list > /dev/null


real    1m36.347s

user    0m3.783s

sys     0m0.381s


$ env|grep INI

EC2_INI_PATH=/etc/ansible/ec2.ini


$ egrep 'cache_path|cache_max_age' $EC2_INI_PATH

cache_path = ~/.ansible/tmp

cache_max_age = 3000



Tony Chia

unread,
Dec 13, 2018, 11:12:05 PM12/13/18
to Ansible Project
You can probably reduce some time by setting the region that expect your resource to be in and one or note tags in the ex2.ini file

Albert Autin

unread,
Dec 14, 2018, 12:46:43 PM12/14/18
to Ansible Project
What's the point of the cache then if it doesn't re-read the cache?
Reply all
Reply to author
Forward
0 new messages