Fix template module incorrectly handling mode when dest is a directory

Fixes #9350
This commit is contained in:
Toshio Kuratomi 2014-10-20 22:15:46 -04:00
commit feb9ed1de8
3 changed files with 41 additions and 5 deletions

View file

@ -133,9 +133,12 @@ class ActionModule(object):
# when running the file module based on the template data, we do
# not want the source filename (the name of the template) to be used,
# since this would mess up links, so we clear the src param and tell
# the module to follow links
# the module to follow links. When doing that, we have to set
# original_basename to the template just in case the dest is
# a directory.
new_module_args = dict(
src=None,
original_basename=os.path.basename(source),
follow=True,
)
# be sure to inject the check mode param into the module args and