Optimize template (#28044)

* Optimize template

* In fixing template to handle diff correctly #24477, I introduced more
  round trips to the remote end which slowed things down  The new code now
  uses one fewer round trips than the old code.
* Reimplement a large part of template by calling the copy action plugin
  instead of doing it in template's code.  This reduces the code in
  template and gives us one place to fix bugs and optimize.
* Add a follow parameter to template that mirrors the follow parameters
  for file and copy.
* Fix copy's diff handling (probably broken in my rewrite for in 2.4
  development)
* Adjusted when copy creates tmp dirs to rduce round trips in copy and
  template.

Fixes #27956
This commit is contained in:
Toshio Kuratomi 2017-08-11 17:50:49 -07:00 committed by GitHub
commit a3132e5dd6
4 changed files with 51 additions and 86 deletions

View file

@ -81,6 +81,13 @@ options:
if the destination does not exist.
type: bool
default: 'yes'
follow:
description:
- This flag indicates that filesystem links in the destination, if they exist, should be followed.
- Previous to Ansible 2.4, this was hardcoded as C(yes).
type: bool
default: 'no'
version_added: "2.4"
notes:
- For Windows you can use M(win_template) which uses '\r\n' as C(newline_sequence).
- Including a string that uses a date in the template will result in the template being marked 'changed' each time