From adb53cc3c58b32a0d41df8bc77c7fefe8cbb1485 Mon Sep 17 00:00:00 2001 From: Andrea Mandolo Date: Mon, 1 Dec 2014 17:51:48 +0100 Subject: [PATCH] Add "block_device_mapping" parameter on EC2_AMI Amazon module (DOCUMENTATION) - upgraded --- lib/ansible/modules/cloud/amazon/ec2_ami.py | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/ec2_ami.py b/lib/ansible/modules/cloud/amazon/ec2_ami.py index 98c41357212..40dc9542c6c 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_ami.py +++ b/lib/ansible/modules/cloud/amazon/ec2_ami.py @@ -69,6 +69,12 @@ options: - Image ID to be deregistered. required: false default: null + device_mapping: + version_added: "1.9" + description: + - An optional list of devices with custom configurations (same block-device-mapping parameters) + required: false + default: null delete_snapshot: description: - Whether or not to delete an AMI while deregistering it. @@ -110,6 +116,23 @@ EXAMPLES = ''' name: newtest register: instance +# AMI Creation, with a custom root-device size and another EBS attached +- ec2_ami + aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx + aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + instance_id: i-xxxxxx + name: newtest + device_mapping: + - device_name: /dev/sda1 + size: XXX + delete_on_termination: true + volume_type: gp2 + - device_name: /dev/sdb + size: YYY + delete_on_termination: false + volume_type: gp2 + register: instance + # Deregister/Delete AMI - ec2_ami: aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx