{{inventory_file}} YAML converted to Python

Dear all

I have a simple playbook that prints a yaml file:

  • hosts: hosts: myhost

tasks:

  • name: show_inventory_file

shell: ‘cat {{inventory_file}}

register: inventory_file_yaml

  • debug:

msg: ‘{{ inventory_file_yaml.stdout }}

when I run it through CLI ansible-playbook -i myinventory.yaml, everything seems to be fine, the format is yaml:

ok: [localhost] => {

“msg”: "all:\n# hosts:\n’…

however if I run the same playbook via AWX using the same inventory yaml,

ok: [localhost] => {

“msg”: "#! /usr/bin/env python\n# -*- coding: utf-8…

So AWX converts yaml inventory to python format automatically

Is there any way to force AWX to make {{inventory_file}} work in AWX the same as when running through ansible-playbook CLI,

i.e. keep the original yaml format, do not convert the inventory to python format?