Skip to content

Missing double quotes when with jinja2_native = true #58527

@hxdoan

Description

@hxdoan
SUMMARY

Double quotes missing on variables.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

!component

ANSIBLE VERSION
ansible 2.7.0
  config file = /home/hdoan@DAA.LOCAL/projects/helix-infrastructure/ansible.cfg
  configured module search path = [u'/home/hdoan@DAA.LOCAL/projects/helix-deploy-scripts/ansible-modules']
  ansible python module location = /home/hdoan@DAA.LOCAL/python2.7/lib/python2.7/site-packages/ansible
  executable location = /home/hdoan@DAA.LOCAL/python2.7/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

CONFIGURATION
ansible-config dump --only-changed
DEFAULT_JINJA2_NATIVE(/home/hdoan@DAA.LOCAL/projects/helix-infrastructure/ansible.cfg) = True
OS / ENVIRONMENT

uname -a
Linux hdoan-dw-vm.daa.local 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

STEPS TO REPRODUCE
- name: 'infratest.yml'
  hosts: 127.0.0.1
  gather_facts: False


  tasks:

  - name: test variable substitution
    vars:
      var1: "var1"
      var2: "var2"
    debug:
        msg: This is a test var1 = "{{ var1 }}" var2 = "{{ var2 }}"
EXPECTED RESULTS

PLAY [infratest.yml] ************************************************************************************************************

TASK [test variable substitution] ***********************************************************************************************
ok: [127.0.0.1] => {
"msg": "This is a test var1 = "var1" var2 = "var2""
}

PLAY RECAP **********************************************************************************************************************
127.0.0.1 : ok=1 changed=0 unreachable=0 failed=0

ACTUAL RESULTS

PLAY [infratest.yml] ************************************************************************************************************

TASK [test variable substitution] ***********************************************************************************************
ok: [127.0.0.1] => {
"msg": "This is a test var1 = "var1 var2 = var2""
}

PLAY RECAP **********************************************************************************************************************
127.0.0.1 : ok=1 changed=0 unreachable=0 failed=0


Metadata

Metadata

Assignees

Labels

affects_2.7This issue/PR affects Ansible v2.7bugThis issue/PR relates to a bug.native_jinjaissues related to jinja native typessupport:coreThis issue/PR relates to code supported by the Ansible Engineering Team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions