Closed ganeshrn closed 6 years ago
Build failed.
Build succeeded.
@ganeshrn We need to put this in Doc that this feature is only supported with Ansible 2.7 and requires jinja2 version to be >= 2.10. This cannot be backported.
And example how one can still convert it into type int
in the parser_template
Build failed.
Build failed.
Fixes #151
The current
json_template
implementation tries to convert the value to int irrespective to the actual type of data.Ansible version 2.7 onwards supports native jinja2 types conversion. Refer https://github.com/ansible-network/network-engine/issues/151#issuecomment-427561789
eg: value: "{{ item.name.acl_name|float }}"
To convert to native jinja2 type by default need to set
jinja2_native
config varaible indefaults
section of active Ansible config file.Note: This feature require jinja2 version to be >= 2.10