mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #3731 from bcoca/jinja_override_typed
now correctly 'types' value pairs that are passed to jinja overrides
This commit is contained in:
commit
cb028b94a4
1 changed files with 2 additions and 1 deletions
|
@ -28,6 +28,7 @@ import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import datetime
|
import datetime
|
||||||
import pwd
|
import pwd
|
||||||
|
import ast
|
||||||
|
|
||||||
class Globals(object):
|
class Globals(object):
|
||||||
|
|
||||||
|
@ -435,7 +436,7 @@ def template_from_file(basedir, path, vars):
|
||||||
data = data[eol+1:]
|
data = data[eol+1:]
|
||||||
for pair in line.split(','):
|
for pair in line.split(','):
|
||||||
(key,val) = pair.split(':')
|
(key,val) = pair.split(':')
|
||||||
setattr(environment,key.strip(),val.strip())
|
setattr(environment,key.strip(),ast.literal_eval(val.strip()))
|
||||||
|
|
||||||
environment.template_class = J2Template
|
environment.template_class = J2Template
|
||||||
t = environment.from_string(data)
|
t = environment.from_string(data)
|
||||||
|
|
Loading…
Reference in a new issue