From 274abb96b1e28b69868e9ce1df04a66cedca286b Mon Sep 17 00:00:00 2001
From: Philip Kirkland <philip.kirkland@suncorp.com.au>
Date: Wed, 17 Jun 2015 14:33:37 +1000
Subject: [PATCH] adding 'encrypted' option into volume dict so ec2 module can
 easily include encrypted volumes

---
 cloud/amazon/ec2.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cloud/amazon/ec2.py b/cloud/amazon/ec2.py
index 2b38c16ccea..20d49ce5995 100644
--- a/cloud/amazon/ec2.py
+++ b/cloud/amazon/ec2.py
@@ -201,7 +201,7 @@ options:
   volumes:
     version_added: "1.5"
     description:
-      - a list of volume dicts, each containing device name and optionally ephemeral id or snapshot id. Size and type (and number of iops for io device type) must be specified for a new volume or a root volume, and may be passed for a snapshot volume. For any volume, a volume size less than 1 will be interpreted as a request not to create the volume.
+      - a list of volume dicts, each containing device name and optionally ephemeral id or snapshot id. Size and type (and number of iops for io device type) must be specified for a new volume or a root volume, and may be passed for a snapshot volume. For any volume, a volume size less than 1 will be interpreted as a request not to create the volume. Encrypt the volume by passing 'encrypted: true' in the volume dict.
     required: false
     default: null
     aliases: []
@@ -672,7 +672,8 @@ def create_block_device(module, ec2, volume):
                            size=volume.get('volume_size'),
                            volume_type=volume.get('device_type'),
                            delete_on_termination=volume.get('delete_on_termination', False),
-                           iops=volume.get('iops'))
+                           iops=volume.get('iops'),
+                           encrypted=volume.get('encrypted', False))
 
 def boto_supports_param_in_spot_request(ec2, param):
     """