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 ec2_launch_template tagging #53432

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
2 participants
@mdaniel
Copy link
Contributor

mdaniel commented Mar 7, 2019

SUMMARY

If one does not provide network_interfaces: in ec2_launch_template:, then the module will still ask AWS to tag a resource of network-interface when launching the instance. However, that configuration is invalid, causing a 400 response from the AWS API

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_launch_template

ADDITIONAL INFORMATION
  1. specify a launch template without network_interfaces:
  2. specify an ec2_asg: that references that launch template
  3. observe the error below
- ec2_launch_template:
    template_name: sample_lt
    # this is actually the default, but for clarity
    network_interfaces: ~
    tags:
        # or whatever
        Role: worker
    # and the rest

- ec2_asg:
    name: sample
    launch_template:
        launch_template_name: sample_lt
        version: '$Default'
    "msg": "Failed to update autoscaling group: An error occurred (ValidationError) when calling the UpdateAutoScalingGroup operation: You must use a valid fully-formed launch template. 'network-interface' is not a valid taggable resource type for this operation."

mdaniel added some commits Mar 7, 2019

Only tag network-interface if the LT specifies one
Otherwise when one tries to create an ASG it will fail citing "one must use a fully-formed launch template"
Cleanup unused imports
And specify the argument types for `params_to_launch_data`; I didn't fix them _all_ because I didn't touch them all
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 7, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 7, 2019

@mdaniel, 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.