Fix to handle user directory within parameter 'template'.
This commit is contained in:
parent
e7a48cfb40
commit
507111f090
1 changed files with 2 additions and 1 deletions
|
@ -156,6 +156,7 @@ EXAMPLES = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -279,7 +280,7 @@ def main():
|
||||||
module.fail_json('Module parameter "template" or "template_url" is required if "state" is "present"')
|
module.fail_json('Module parameter "template" or "template_url" is required if "state" is "present"')
|
||||||
|
|
||||||
if module.params['template'] is not None:
|
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:
|
else:
|
||||||
template_body = None
|
template_body = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue