From 74f950936a43ce13b6e15ebd92d6a829a7a88ea8 Mon Sep 17 00:00:00 2001 From: jonjozwiak Date: Thu, 28 Sep 2017 20:22:00 -0500 Subject: [PATCH] Fix ec2_win_password to allow blank key_passphrase (#28791) --- lib/ansible/modules/cloud/amazon/ec2_win_password.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_win_password.py b/lib/ansible/modules/cloud/amazon/ec2_win_password.py index 78268bc0cc..ad7715defa 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_win_password.py +++ b/lib/ansible/modules/cloud/amazon/ec2_win_password.py @@ -133,7 +133,10 @@ def main(): instance_id = module.params.get('instance_id') key_file = module.params.get('key_file') - b_key_passphrase = to_bytes(module.params.get('key_passphrase'), errors='surrogate_or_strict') + if module.params.get('key_passphrase') is None: + b_key_passphrase = None + else: + b_key_passphrase = to_bytes(module.params.get('key_passphrase'), errors='surrogate_or_strict') wait = module.params.get('wait') wait_timeout = int(module.params.get('wait_timeout'))