-
Notifications
You must be signed in to change notification settings - Fork 342
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
ec2_instance keeps default value even if set in launch template #462
Comments
This issue was fixed by ansible-collections/community.aws#413 and should be available in the latest versions of this collection. |
Hmm, actually, night not me |
Thats #451 |
...because |
Hi @emanuele-leopardi, could you please take a look at #587? Once it is merged, it should likely resolve this issue. |
@mandar242 It looks good to me, thank you for your hard work :) |
… default value for instance_type (#587) ec2_instance: Fix launch template condition, handle launch template - default value for instance_type SUMMARY The launch_template option in ec2_instance has a broken condition. Also the launch_template option defaults the instance_type to t2.micro if not specified and ignores the instance_type specified in the launch_template as said in the issue #451. Fixes #451 #462 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION The change does not break existing functionality as tested by the integration test run locally. Related to the condition fix in community.aws: ansible-collections/community.aws#111 Ran the following playbook to verify the change. # create a launch template called "test-launch-template" - name: create test launch template community.aws.ec2_launch_template: template_name: test-launch-template image_id: ami-002068ed284xxxxxx instance_type: t3a.small network_interfaces: - associate_public_ip_address: no delete_on_termination: yes device_index: 0 groups: - sg-xxxxxxxxxxxxxxxxxx subnet_id: subnet-xxxxxxxxxxxxxxxxxx region: us-east-2 block_device_mappings: - device_name: /dev/sdb ebs: volume_size: 5 volume_type: gp3 delete_on_termination: true encrypted: yes - device_name: /dev/sdc ebs: volume_size: 2 volume_type: gp2 delete_on_termination: true encrypted: no tags: ssome: tags # launch a ec2 instance using launch template created earlier - launches t3a.small instance as expected - name: test launch template usage ec2_instance: wait: yes name: "test-instance-mk-t3a.small" launch_template: name: test-launch-template vpc_subnet_id: subnet-xxxxxxxxxxxxxxxxxx # launch ec2 instance using launch template created earlier - override instance type to be launch to t3.xlarge - name: test launch template usage - override instance type ec2_instance: wait: yes name: "test-instance-mk-t3.xlarge" instance_type: t3.xlarge launch_template: name: test-launch-template vpc_subnet_id: subnet-xxxxxxxxxxxxxxxxxx Reviewed-by: Jill R <None> Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Emanuele Leopardi <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
Closing the issue as fix is merged #587. |
SUMMARY
It looks like there are still some default values that are not taken into account by this module even if passing a launch template
ISSUE TYPE
COMPONENT NAME
ec2_instance
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
MacOS 11.2.3
STEPS TO REPRODUCE
First of all let's define some variables
then we use this to create a nice ec2_launch_template
we register the Id and then we use it to call ec2_instance
EXPECTED RESULTS
The expected result is that the instance gets create with instance.instance_type == t3.micro
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: