ansible / ansible-dev-tools

Ansible automation developer tools
https://ansible.readthedocs.io/projects/dev-tools/
GNU General Public License v3.0
82 stars 28 forks source link

ansible-community + collections missing from pipx install #290

Closed pabigot closed 3 months ago

pabigot commented 4 months ago

When I use pipx to install ansible-dev-tools like this:

sudo pipx install --include-deps --global ansible-dev-tools

I get everything except the site package ansible-collections is missing. This is demonstrated by:

pab-laptop[107]$ ansible-galaxy collection list
usage: ansible-galaxy [-h] [--version] [-v] TYPE ...

Perform various Role and Collection related operations.

positional arguments:
  TYPE
    collection   Manage an Ansible Galaxy collection.
    role         Manage an Ansible Galaxy role.

options:
  --version      show program's version number, config file location, configured module search path, module location,
                 executable location and exit
  -h, --help     show this help message and exit
  -v, --verbose  Causes Ansible to print more debug messages. Adding multiple -v will increase the verbosity, the
                 builtin plugins currently evaluate up to -vvvvvv. A reasonable level to start is -vvv, connection
                 debugging might require -vvvv. This argument may be specified multiple times.
ERROR! - None of the provided paths were usable. Please specify a valid path with --collections-path

If I then do:

sudo pipx uninstall --global ansible-dev-tools
sudo pipx install --include-deps --global ansible

then I get:

pab-laptop[111]$ ansible-galaxy collection list

# /opt/pipx/venvs/ansible/lib/python3.10/site-packages/ansible_collections
Collection                               Version
---------------------------------------- -------
amazon.aws                               8.0.1  
ansible.netcommon                        6.1.3  
ansible.posix                            1.5.4  
ansible.utils                            4.1.0  
ansible.windows                          2.4.0  
...

Looking at the differences it appears that installing ansible includes the app ansible-community, which is not present when installing ansible-dev-tools.

installed package ansible 10.1.0, installed using Python 3.10.12
  These apps are now globally available
    - ansible
    - ansible-community    <===
    - ansible-config
    - ansible-connection
    - ansible-console
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
    - ansible-playbook
    - ansible-pull
    - ansible-test
    - ansible-vault
done!

vs:

installed package ansible-dev-tools 24.6.1, installed using Python 3.10.12
  These apps are now globally available
    - ade
    - adt
    - ansible
    - ansible-builder
    - ansible-config
    - ansible-connection
    - ansible-console
    - ansible-creator
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
...

I'm currently working around this by installing both, but replacing the global links so that anything in ansible comes from there rather than from ansible-dev-tools.

ssbarnea commented 3 months ago

This is not possible as collections are not python packages.

pabigot commented 3 months ago

This is not possible as collections are not python packages.

@ssbarnea could you expand on that a little, please? A pipx install of ansible is able to provide "a community-curated selection of Ansible Collections", but a pipx install of ansible-dev-tools can't, even though it contains everything else from the ansible pipx install?