I’m meeting a problem that:
When using Ansible ec2_elb_facts module to gather ALL elb info in an aws account, it kept failed even if retry_times=100+
However, when using Shell to call aws cli directly, it is fast.
So, Im wondering what does ansible module do when communicating with AWS especially for ec2_elb_facts module.
I got following logs when executing ansible playbook to gather elb information:
2018-01-05 14:37:23,083 p=6721 u=xx | 6800 1515134243.08363: getting output with communicate()
2018-01-05 14:38:49,437 p=6721 u=xx | 6800 1515134329.43786: done communicating
2018-01-05 14:38:49,438 p=6721 u=xx | 6800 1515134329.43809: done with local.exec_command()
2018-01-05 14:38:49,440 p=6721 u=xx | 6800 1515134329.43893: _low_level_execute_command() done: rc=0, stdout=
All fast except the there is a great time gap between the first two line. This log is only for test, when running in our actual environment, it keeps more than half an hour and then failed.
This is ansible code:
- name: Gathering ELB information - all in the account
ec2_elb_facts:
aws_access_key: “{{ AWS_ACCESS_KEY }}”
aws_secret_key: “{{ AWS_SECRET_KEY }}”
region: “{{ AWS_REGION }}”
register: ELB_INFO
until: ELB_INFO.failed is not defined or ELB_INFO.failed == false
retries: 100
delay: 5
Can anyone help me to figure out what happened between “getting output with communicate()” and “done communicating”?
Why it is so slow and leads to fail when running in my real aws envrionment?
Thanks in advance!