Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error KeyError: LaunchTemplate on terminating instances. #53014

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
2 participants
@brandond
Copy link
Contributor

brandond commented Feb 26, 2019

This isn't an either-or situation; a node may have neither a LC nor a LT.

SUMMARY

A recent change to this module seems to have made the incorrect assumption that autoscaling instances will always have either a LaunchConfigurationName or a LaunchTemplate. This is not true; terminating instances have neither:

        {
            "ProtectedFromScaleIn": false,
            "AvailabilityZone": "us-west-2b",
            "InstanceId": "i-0628a417c2a36c37b",
            "AutoScalingGroupName": "D01-egress-proxy-asg",
            "HealthStatus": "UNHEALTHY",
            "LifecycleState": "Terminating"
        },
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

modules/cloud/amazon/ec2_asg

ADDITIONAL INFORMATION
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'LaunchTemplate' fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
  File \"<stdin>\", line 114, in <module>
  File \"<stdin>\", line 106, in _ansiballz_main
  File \"<stdin>\", line 49, in invoke_module
  File \"/tmp/ansible_ec2_asg_payload_hT8HoF/__main__.py\", line 1672, in <module>
  File\"/tmp/ansible_ec2_asg_payload_hT8HoF/__main__.py\", line 1658, in main
  File \"/tmp/ansible_ec2_asg_payload_hT8HoF/__main__.py\", line 1022, in create_autoscaling_group
  File \"/tmp/ansible_ec2_asg_payload_hT8HoF/__main__.py\", line 635, in get_properties
KeyError: 'LaunchTemplate'
", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}
Fix error KeyError: LaunchTemplate on terminating instances.
This isn't an either-or situation; a node may have neither a LC nor a LT.
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 26, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 26, 2019

@brandond, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.