Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

s/--content-paths/--collections-path for install, make use of ansible_collection consistent with ansible #239

Closed
alikins opened this issue May 7, 2019 · 1 comment · Fixed by #240

Comments

@alikins
Copy link
Contributor

alikins commented May 7, 2019

Bug Report

At the moment, 'mazer install --content-path /tmp/some_dir some_namespace.some_name' will install the 'foo.bar' collection directly to /tmp/some_dir/some_namespace.

But, the above won't work directly, since there is no 'ansible_collections' path between 'some_dir' and 'some_namespace'.

ansible-playbook will read an ANSIBLE_COLLECTIONS_PATHS env variable, which is expected to be colon separated directory paths that point to the dir before 'ansible_collections'

ie, ANSIBLE_COLLECTIONS_PATHS=/tmp/some_dir will not find the collections installed with
'mazer install --content-path /tmp/some_dir`.

Possible fixes

After changing --content-path to be --collections_path

  1. Always append the 'ansible_collections' dir to whatever is provided for --collections_path

    • More DWIM, but also unusual and different from 'ansible-galaxy --roles-path'
  2. Use it explicit with expectation that users will need to include the 'ansible_collections'

    • Kind of leaks an implementation detail to the UX

The main issue with 1) is that it isn't obvious how to install a playbook adjacent collection

Need to end up with

.
myplaybook.yml
ansible_collections/
ansible_collections/some_namespace
<...>

mazer install --collections_path ansible_collections for 1) would result in

.
myplaybook.yml
<...>
ansible_collections/ansible_collections/some_namespace

For case above with 1), a user could need to cd to that dir, then 'mazer install --collections_path .`

alikins added a commit to alikins/mazer that referenced this issue May 7, 2019
alikins added a commit to alikins/mazer that referenced this issue May 7, 2019
@ironfroggy
Copy link
Contributor

@alikins I'd like to advocate for --collections-path over --collections_path! Conventions are important and the standard dash separator in parameters is both far more common, so users will expect it, and essentially standard across all other Ansible CLI tools.

alikins added a commit to alikins/mazer that referenced this issue May 8, 2019
In particular, content_root->collections_path.

Fixes: ansible#239
alikins added a commit to alikins/mazer that referenced this issue May 8, 2019
In particular, content_root->collections_path.

Fixes: ansible#239
alikins added a commit to alikins/mazer that referenced this issue May 8, 2019
WARNING: This will break any existing mazer.yml config
file, as it changes the 'content_path' named key
to now be 'collections_path'.

No attempt is made to preserve compatibilty with
config files used with mazer 0.4 or earlier.

Also change global_content_path -> global_collections_path

Fixes: ansible#239
alikins added a commit to alikins/mazer that referenced this issue May 8, 2019
alikins added a commit to alikins/mazer that referenced this issue May 8, 2019
In particular, content_root->collections_path.

Fixes: ansible#239
alikins added a commit to alikins/mazer that referenced this issue May 8, 2019
In particular, content_root->collections_path.

Fixes: ansible#239
alikins added a commit that referenced this issue May 8, 2019
WARNING: This will break any existing mazer.yml config
file, as it changes the 'content_path' named key
to now be 'collections_path'.

No attempt is made to preserve compatibilty with
config files used with mazer 0.4 or earlier.

Also change global_content_path -> global_collections_path

Fixes: #239
alikins added a commit that referenced this issue May 8, 2019
In particular, content_root->collections_path.

Fixes: #239
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants