From 32980f214a4df97aee871ffd86168bb1cff804a8 Mon Sep 17 00:00:00 2001 From: Prasad Katti Date: Thu, 10 Oct 2019 13:36:56 -0700 Subject: [PATCH] [ec2_launch_template] Update examples (#63152) - Update tasks names for existing examples - Add a new example showing how to delete a launch template --- .../cloud/amazon/ec2_launch_template.py | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_launch_template.py b/lib/ansible/modules/cloud/amazon/ec2_launch_template.py index 85a269e5353..13567f2880c 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_launch_template.py +++ b/lib/ansible/modules/cloud/amazon/ec2_launch_template.py @@ -286,24 +286,29 @@ options: ''' EXAMPLES = ''' -- name: Make instance with an instance_role +- name: Create an ec2 launch template ec2_launch_template: - name: "test-with-instance-role" - image_id: "ami-foobarbaz" + name: "my_template" + image_id: "ami-04b762b4289fba92b" key_name: my_ssh_key instance_type: t2.micro iam_instance_profile: myTestProfile disable_api_termination: true -- name: Make one with a different instance type, but leave the older version as default +- name: > + Create a new version of an existing ec2 launch template with a different instance type, + while leaving an older version as the default version ec2_launch_template: - name: "test-with-instance-role" - image_id: "ami-foobarbaz" + name: "my_template" default_version: 1 - key_name: my_ssh_key instance_type: c5.4xlarge - iam_instance_profile: myTestProfile - disable_api_termination: true + +- name: Delete an ec2 launch template + ec2_launch_template: + name: "my_template" + state: absent + +# This module does not yet allow deletion of specific versions of launch templates ''' RETURN = '''