Skip to content

Inventory stored as a python script printing it, parsed with a yaml parser #3365

@JulienPalard

Description

@JulienPalard
ISSUE TYPE
  • Bug Report
SUMMARY

Erreur parsing scm-project-imported yml inventory.

ENVIRONMENT
  • AWX version: 3.0.1.0
  • AWX install method: docker on linux
  • Ansible version: 2.7.7
  • Operating System: Debian 9.8
  • Web Browser: Firefox 65.0
STEPS TO REPRODUCE
  • Create a git repo with a yml inventory
  • Create a project from a git repo
  • Create an inventory
  • Source the inventory from the project
  • Create a job template using this inventory
ACTUAL RESULTS
Enter passphrase for /tmp/awx_20_1hyd0bnn/credential_4: 
Identity added: /tmp/awx_20_1hyd0bnn/credential_4 (awx@awx1)
SSH password: 
 [WARNING]:  * Failed to parse /tmp/awx_20_1hyd0bnn/tmpekssw087 with yaml
plugin: Syntax Error while loading YAML.   did not find expected key  The error
appears to have been in '/tmp/awx_20_1hyd0bnn/tmpekssw087': line 3, column 89,
but may be elsewhere in the file depending on the exact syntax problem.  The
offending line appears to be:  # -*- coding: utf-8 -*- print('{"all": {"vars":
{"ansible_python_interpreter": "/usr/bin/python3"}, "hosts": []}, " [... my whole inventory here, redacted for readability and privacy...]"}}}}')
^ here We could be wrong, but this one looks like it might be an issue with
unbalanced quotes.  If starting a value with a quote, make sure the line ends
with the same set of quotes.  For instance this arbitrary example:      foo:
"bad" "wolf"  Could be written as:      foo: '"bad" "wolf"'

 [WARNING]: Unable to parse /tmp/awx_20_1hyd0bnn/tmpekssw087 as an inventory
source

ERROR! No inventory was parsed, please check your configuration and options.
ADDITIONAL INFORMATION

The problem looks like the inventory was stored as a python script printing the inventory, and is parsed using a yaml parser.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions