Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error in yaml file tools/docker-compose/ansible/roles/sources/tasks/main.yml #14317

Closed
5 of 11 tasks
Zambot1971 opened this issue Aug 4, 2023 · 2 comments · Fixed by #14589
Closed
5 of 11 tasks

Comments

@Zambot1971
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to security@ansible.com instead.)

Bug Summary

Hi,
this is the error that ansible throw (via cli is the same) while running the command:

make docker-compose COMPOSE_UP_OPTS=-d

Syntax Error while loading YAML.
  did not find expected '-' indicator

The error appears to be in '/home/awxadmin/awx/tools/docker-compose/ansible/roles/sources/tasks/main.yml': line 51, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

      error_code: "{{ item | basename() | regex_replace('custom_(\\d+).html', '\\1') }}"
      web_path: "{{ item | regex_replace('^.*\/static', '/static') }}"
                                             ^ here

thank for your efforts
regards

AWX version

22.6.1

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

docker development environment

Modifications

no

Ansible version

2.9.27

Operating system

RHEL 8

Web browser

No response

Steps to reproduce

following the procedure in your documentation (https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md) the command:
make docker-compose COMPOSE_UP_OPTS=-d
throws the error reported above

Expected results

no yaml syntax error

Actual results

Syntax Error while loading YAML.
  did not find expected '-' indicator

The error appears to be in '/home/awxadmin/awx/tools/docker-compose/ansible/roles/sources/tasks/main.yml': line 51, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

      error_code: "{{ item | basename() | regex_replace('custom_(\\d+).html', '\\1') }}"
      web_path: "{{ item | regex_replace('^.*\/static', '/static') }}"
                                             ^ here

Additional information

removing the escapint slash before the first /static occurrence:
before
web_path: "{{ item | regex_replace('^./static', '/static') }}"
after
web_path: "{{ item | regex_replace('^.
/static', '/static') }}"
the procedure succeeds

@fosterseth
Copy link
Member

Might be related to your version of ansible, does upgrading ansible help?

you could also open a PR with your suggested code change, and we can test it further.

@Zambot1971
Copy link
Author

This is my ansible version:
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, May 31 2023, 10:28:59) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)]

To which version am I supposed to upgrade? I'd like to stick to the stable version coming with the rhel package.
Btw if the bug does not affect other versions nor other users are experiencing the issue, it is not a problem, I've fixed it with a modified version with ansible and the procedure succeeds.
Thanks for your answer

obaranov added a commit to obaranov/awx that referenced this issue Oct 19, 2023
obaranov added a commit to obaranov/awx that referenced this issue Oct 20, 2023
obaranov added a commit to obaranov/awx that referenced this issue Oct 23, 2023
AlanCoding pushed a commit to AlanCoding/awx that referenced this issue Jan 22, 2024
Co-authored-by: Oleksii Baranov <olebaran@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants