mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 13:59:09 -07:00
Add code to flag legacy templating like $foo.{bar} as deprecated in favor of Jinja2 {{ foo.bar }} so we
can remove the legacy system at a later date.
This commit is contained in:
parent
804056a563
commit
b09ef21ec9
13 changed files with 102 additions and 61 deletions
|
@ -18,6 +18,7 @@
|
|||
import os
|
||||
|
||||
from ansible import utils
|
||||
from ansible import template
|
||||
from ansible import errors
|
||||
from ansible.runner.return_data import ReturnData
|
||||
import base64
|
||||
|
@ -54,7 +55,7 @@ class ActionModule(object):
|
|||
if 'first_available_file' in inject:
|
||||
found = False
|
||||
for fn in inject.get('first_available_file'):
|
||||
fn = utils.template(self.runner.basedir, fn, inject)
|
||||
fn = template.template(self.runner.basedir, fn, inject)
|
||||
fn = utils.path_dwim(self.runner.basedir, fn)
|
||||
if not os.path.exists(fn) and '_original_file' in inject:
|
||||
fn = utils.path_dwim_relative(inject['_original_file'], 'files', fn, self.runner.basedir, check=False)
|
||||
|
@ -77,7 +78,7 @@ class ActionModule(object):
|
|||
f.close()
|
||||
source = tmp_content
|
||||
else:
|
||||
source = utils.template(self.runner.basedir, source, inject)
|
||||
source = template.template(self.runner.basedir, source, inject)
|
||||
if '_original_file' in inject:
|
||||
source = utils.path_dwim_relative(inject['_original_file'], 'files', source, self.runner.basedir)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue