From 814efc1418c4e33615b9f840c4dd551bfcb857dc Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 10 May 2016 12:23:08 +0200 Subject: [PATCH] Use path type for blockinfile 'dest' argument (#2192) --- lib/ansible/modules/extras/files/blockinfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/files/blockinfile.py b/lib/ansible/modules/extras/files/blockinfile.py index eadf3a622dd..0fc0fc73cb4 100644 --- a/lib/ansible/modules/extras/files/blockinfile.py +++ b/lib/ansible/modules/extras/files/blockinfile.py @@ -188,7 +188,7 @@ def check_file_attrs(module, changed, message): def main(): module = AnsibleModule( argument_spec=dict( - dest=dict(required=True, aliases=['name', 'destfile']), + dest=dict(required=True, aliases=['name', 'destfile'], type='path'), state=dict(default='present', choices=['absent', 'present']), marker=dict(default='# {mark} ANSIBLE MANAGED BLOCK', type='str'), block=dict(default='', type='str', aliases=['content']), @@ -204,7 +204,7 @@ def main(): ) params = module.params - dest = os.path.expanduser(params['dest']) + dest = params['dest'] if module.boolean(params.get('follow', None)): dest = os.path.realpath(dest)