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

Importing an inventory sourced from a manual project fails #15475

Open
5 of 11 tasks
jean-christophe-manciot opened this issue Aug 28, 2024 · 1 comment
Open
5 of 11 tasks

Comments

@jean-christophe-manciot

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 [email protected] instead.)

Bug Summary

As a workaround to the already reported issue Source From A Project Doesn't Show Any Inventory, I used to be able to import inventories sourced from manual projects with the command awx-manage inventory_import run from within the tools_awx_1 container.
With AWX 24.6.0, this command now fails.

AWX version

24.6.0

Select the relevant components

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

Installation method

docker development environment

Modifications

no

Ansible version

2.17.3

Operating system

Ubuntu 24.04 noble

Web browser

No response

Steps to reproduce

  • Install AWX 24.6.0 using docker-compose
  • Add a projects docker volume for tools_awx container
  • Add all inventories projects
  • Add all playbooks projects
  • Add all roles projects
  • Add all inventories
  • Import all inventories sourced from the manual projects as a workaround to the issue 'Cannot use manual project for SCM-based inventory' - that issue prevents us from using awx.awx.inventory_source module with manual projects as "source"

Expected results

Successful Import of all inventories sourced from the manual projects

Actual results

sh-5.1# awx-manage inventory_import --inventory-name Inventory-1 --source /var/lib/awx/projects/git-Inventory-1/ --overwrite --overwrite-vars
    2.358 INFO     Updating inventory 2: Inventory-1
2024-08-28 14:05:21,641 INFO     [-] awx.analytics.job_lifecycle inventoryupdate-25 created {"type": "inventoryupdate", "task_id": 25, "state": "created", "work_unit_id": null, "task_name": "Inventory-1 -  (Inventory-1 - 25)"}
    2.476 INFO     Reading Ansible inventory source: /var/lib/awx/projects/git-Inventory-1
Traceback (most recent call last):
  File "/usr/local/bin/awx-manage", line 18, in <module>
    load_entry_point('awx', 'console_scripts', 'awx-manage')()
  File "/awx_devel/awx/__init__.py", line 177, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/awx_devel/awx/main/management/commands/inventory_import.py", line 896, in handle
    data = AnsibleInventory-1Loader(source=source, verbosity=verbosity).load()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/awx_devel/awx/main/management/commands/inventory_import.py", line 132, in load
    return self.command_to_json(base_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/awx_devel/awx/main/management/commands/inventory_import.py", line 116, in command_to_json
    raise RuntimeError('%s failed (rc=%d) with stdout:\n%s\nstderr:\n%s' % ('ansible-inventory', proc.returncode, stdout, stderr))
RuntimeError: ansible-inventory failed (rc=127) with stdout:

stderr:
Error: crun: writing file `/sys/fs/cgroup/libpod_parent/libpod-4ccd4c5a4e1c85d9328a135745860ec898efe81e4a4548a0bbc279935aed7191/cgroup.procs`: No such file or directory: OCI runtime attempted to invoke a command that was not found

sh-5.1# ls -al /var/lib/awx/projects/git-Inventory-1
total 36
drwxr-x---  4 root root  4096 Aug 28 12:53 .
drwxr-x--- 19 root root  4096 Feb 27  2024 ..
drwxr-x--- 66 root root  4096 Aug 27 15:29 group_vars
-rw-r-----  1 root root 20321 Aug 27 15:29 hosts
drwxr-x--- 14 root root  4096 Aug 27 15:29 host_vars

Additional information

No response

@GitGorgon
Copy link

When you see problems like this you realise the developers care absolutely nothing about making AWX usable

No doubt all the devs are workign on this: #13737 "Improvements to the AWX development experience](#13737"

The "development" experience is super-important of course, but the user experience?
Nah. Devs do not care one tiny little jot about that.

Incredible isn't it, to think that I can pass ansible a folder with '-i /path/to/folder', and ansible will parse that in a second and make full use of it...

But after years of development, useless "smart inventories", absurd requirements to use awx-manage, and the issue 'Cannot use manual project for SCM-based inventory' - that prevents us from using awx.awx.inventory_source module with manual projects as "source" - now, smart inventories are deprecated as well as being useless. And now we have "constructed inventories"... and yet, AWX cannot simply import an inventory from a file like Ansible cmdline can.

The stupidity, and the contempt for users is mind-boggling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants