From 5c04f25245f8b54390b02cc5b054b616a5be6771 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 13 Jan 2020 08:43:13 +0530 Subject: [PATCH] ec2_lc: Update example to use snapshot id (#66064) Fixes: #52085 Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/cloud/amazon/ec2_lc.py | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/ec2_lc.py b/lib/ansible/modules/cloud/amazon/ec2_lc.py index ea96c02b1b6..82d4364aee3 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_lc.py +++ b/lib/ansible/modules/cloud/amazon/ec2_lc.py @@ -249,6 +249,30 @@ EXAMPLES = ''' volumes: - device_name: /dev/sdf no_device: true + +- name: Use EBS snapshot ID for volume + block: + - name: Set Volume Facts + set_fact: + volumes: + - device_name: /dev/sda1 + volume_size: 20 + ebs: + snapshot: snap-XXXX + volume_type: gp2 + delete_on_termination: true + encrypted: no + + - name: Create launch configuration + ec2_lc: + name: lc1 + image_id: ami-xxxx + assign_public_ip: yes + instance_type: t2.medium + key_name: my-key + security_groups: "['sg-xxxx']" + volumes: "{{ volumes }}" + register: lc_info ''' RETURN = '''