From 325a979876125d38198334b262f3f4bc03fa1b96 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Wed, 9 Dec 2015 10:07:16 +0700 Subject: [PATCH] Set the argument type for ec2_vol's encrypted parameter If this is not set, Ansible parses the parameter as a string. This is fine if the parameter is not provided by the caller, but if it is set to False or True explicitly, ec2_vol receives this as the string 'False' or the string 'True', both of which are truthy. Thus, without this fix, setting the parameter results in encryption always enabled. --- lib/ansible/modules/cloud/amazon/ec2_vol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vol.py b/lib/ansible/modules/cloud/amazon/ec2_vol.py index f94415cb5d8..8850cb44a2e 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vol.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vol.py @@ -377,7 +377,7 @@ def main(): volume_size = dict(), volume_type = dict(choices=['standard', 'gp2', 'io1'], default='standard'), iops = dict(), - encrypted = dict(), + encrypted = dict(type='bool', default=False), device_name = dict(), zone = dict(aliases=['availability_zone', 'aws_zone', 'ec2_zone']), snapshot = dict(),