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

cope with an AWS Auto Scaling Group containing instances not having a launch config any more #57737

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
2 participants
@adq
Copy link

commented Jun 12, 2019

SUMMARY

We ran into a corner case:

  • Create an ASG with a launch config.
  • Create some instances in it.
  • Now, change the ASG's launch config, but do not remove the existing instances from the old LC.
  • Delete the old launch config.
  • Now, you'll have instances in the ASG which amazon reports as not having a launch config.

Due to the changes in 2.8.0 to support launch templates, this falls into a hole in get_properties(). Since the instance does not have a "LaunchConfigurationName" or "LaunchTemplate" key, it ends up with neither launch_config_name nor launch_template set, so does not set a value in the dict.

Later on, get_instances_by_launch_template assumes it the dict DOES have a launch_config_name, and you get a failure (see below for example).

It would be good to get this into 2.8.x as a bugfix as well. We found this during a production deploy.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_asg

ADDITIONAL INFORMATION

Example error trace:

  File \"<stdin>\", line 114, in <module>
  File \"<stdin>\", line 106, in _ansiballz_main
  File \"<stdin>\", line 49, in invoke_module
  File \"/home/teamcity/agent/temp/buildTmp/ansible_ec2_asg_payload_p7LfUo/__main__.py\", line 1677, in <module>
  File \"/home/teamcity/agent/temp/buildTmp/ansible_ec2_asg_payload_p7LfUo/__main__.py\", line 1670, in main
  File \"/home/teamcity/agent/temp/buildTmp/ansible_ec2_asg_payload_p7LfUo/__main__.py\", line 1312, in replace
  File \"/home/teamcity/agent/temp/buildTmp/ansible_ec2_asg_payload_p7LfUo/__main__.py\", line 1385, in get_instances_by_launch_config
KeyError: 'launch_config_name'
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

@adq, 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

@adq adq changed the title cope with an ASG instance not having a launch config any more cope with an AWS Auto Scaling Group containing instances not having a launch config any more Jun 12, 2019

@ansibot ansibot added the stale_ci label Jun 20, 2019

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.