From 507111f090838558d0fcbd7557269e787ebaf894 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Fri, 25 Sep 2015 21:59:14 +0000 Subject: [PATCH] Fix to handle user directory within parameter 'template'. --- lib/ansible/modules/cloud/amazon/cloudformation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation.py b/lib/ansible/modules/cloud/amazon/cloudformation.py index 3ded15a03f7..44a9f9ef212 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation.py @@ -156,6 +156,7 @@ EXAMPLES = ''' ''' import json +import os import time import yaml @@ -279,7 +280,7 @@ def main(): module.fail_json('Module parameter "template" or "template_url" is required if "state" is "present"') if module.params['template'] is not None: - template_body = open(module.params['template'], 'r').read() + template_body = open(os.path.expanduser(module.params['template']), 'r').read() else: template_body = None