Python 2.7.10
ansible (2.0.0.2)
boto (2.38.0)
botocore (1.3.20)
running the playbook to update an existing autoscaling group, I started getting this error last week:
TASK [Update Autoscaling Group] ************************************************
task path: /opt/hephaestus/ansible/tasks/update-asg.yaml:13
ESTABLISH LOCAL CONNECTION FOR USER: root
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737 )" )
localhost PUT /tmp/tmpSYEg2V TO /root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg; rm -rf "/root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/" > /dev/null 2>&1
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg", line 2998, in <module>
main()
File "/root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg", line 2987, in main
create_changed, asg_properties=create_autoscaling_group(connection, module)
File "/root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg", line 2664, in create_autoscaling_group
wait_for_elb(connection, module, group_name)
File "/root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg", line 2526, in wait_for_elb
healthy_instances = elb_healthy(asg_connection, elb_connection, module, group_name)
File "/root/.ansible/tmp/ansible-tmp-1453161674.67-268535195031737/ec2_asg", line 2500, in elb_healthy
except boto.exception.InvalidInstance, e:
AttributeError: 'module' object has no attribute 'InvalidInstance'
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "ec2_asg"}, "parsed": false}
I have tried to change the version of boto and ansible, however the error now persists. I have not been able to identify any root cause or known bug other than the error message. I have tried switching a few options on and off in the playbook such as: wait_for_instances and lc_check.
Thanks!
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/15bb28c2-e25b-40ac-be8d-da4630e5f729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
failed: [localhost] => {"failed": true, "parsed": false}
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1453831301.21-186005588822085/ec2_asg", line 2455, in <module>
main()
File "/root/.ansible/tmp/ansible-tmp-1453831301.21-186005588822085/ec2_asg", line 2444, in main
create_changed, asg_properties=create_autoscaling_group(connection, module)
File "/root/.ansible/tmp/ansible-tmp-1453831301.21-186005588822085/ec2_asg", line 2246, in create_autoscaling_group
wait_for_elb(connection, module, group_name)
File "/root/.ansible/tmp/ansible-tmp-1453831301.21-186005588822085/ec2_asg", line 2113, in wait_for_elb
except boto.exception.InvalidInstance, e:
AttributeError: 'module' object has no attribute 'InvalidInstance'
ansible/modules/core/cloud/amazon/ec2_asg.py
def elb_healthy(asg_connection, elb_connection, module, group_name):
healthy_instances = []
as_group = asg_connection.get_all_groups(names=[group_name])[0]
props = get_properties(as_group)
# get healthy, inservice instances from ASG
instances = []
for instance, settings in props['instance_facts'].items():
if settings['lifecycle_state'] == 'InService' and settings['health_status'] == 'Healthy':
instances.append(instance)
log.debug("ASG considers the following instances InService and Healthy: {0}".format(instances))
log.debug("ELB instance status:")
for lb in as_group.load_balancers:
# we catch a race condition that sometimes happens if the instance exists in the ASG
# but has not yet show up in the ELB
try:
lb_instances = elb_connection.describe_instance_health(lb, instances=instances)
except boto.exception.InvalidInstance, e:
pass
for i in lb_instances:
if i.state == "InService":
healthy_instances.append(i.instance_id)
log.debug("{0}: {1}".format(i.instance_id, i.state))
return len(healthy_instances)
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/15bb28c2-e25b-40ac-be8d-da4630e5f729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.