Not positive I understand, but if you want to use some arbitrary directory,
it must be in a path that matches
`collections/ansible_collections/<namespace>/<name>`

But my instructions still stand, regardless of using a vcs, they show how
to put a collection in place without use of ansible-galaxy. You just need
to drop the collection in a path that ansible is configured to look for,
and it must be structured as I mentioned above.

You can configure the paths that ansible looks using
https://docs.ansible.com/ansible-core/devel/reference_appendices/config.html#collections-paths



On Wed, Feb 22, 2023 at 2:09 PM Roman Dodin <dodin.ro...@gmail.com> wrote:

> Thanks Matt,
>
> Q1 was not about vcs, maybe I poorly explained the problem. I was
> wondering how to make a collection source to be picked up by the playbooks
> *without* installing collection with galaxy-install.
> I found only one way of doing it: tuning collections_path, but the problem
> is that this cfg item expects a strict folder structure. e.g. it needs to
> point to a dir D that has X/Y subdirs, where X is the namespace of the
> collection and Y is the collection name. Clearly, this messes up with
> whatever dir structure you have on your dev machine.
> So if you started your project in dir structure such as ~/E/F, then you
> can't use collections_path.
>
> On Wed, Feb 22, 2023 at 8:57 PM Matt Martz <m...@sivel.net> wrote:
>
>> 1) You just use normal `git` or whatever your version control system is:
>>
>> cd ~/.ansible/collections/ansible_collections
>> rm -rf amazon/aws
>> mkdir -p amazon
>> cd amazon
>> git clone https://github.com/ansible-collections/amazon.aws.git aws
>>
>> 2) I don't know about IDEs, but the PYTHONPATH for those is managed by
>> ansible during runtime effectively.  But basically, for the example above:
>> PYTHONPATH=~/.ansible/collections/.  You can use `ansible-config dump |
>> grep COLLECTIONS_PATHS` to see the default paths used.
>>
>> On Wed, Feb 22, 2023 at 12:58 PM Roman Dodin <dodin.ro...@gmail.com>
>> wrote:
>>
>>> Hi all,
>>> I am developing a collection following the dir layout as prescribed by
>>> the skeleton.
>>> I have the following 2 questions re dev workflows
>>>
>>> 1) How do you install the collection that you're developing in the "edit
>>> mode", like with pip you do `pip install -e`, and then you can do changes
>>> to the modules on-the-fly and they will be picked up.
>>> What is the alternative to that process with galaxy collection? Should I
>>> always do a `galaxy collection install ...` and then run my playbooks every
>>> time I touch the contents of my collection?
>>>
>>> 2) When developing modules inside the collection people reference
>>> funcs/methods from inside the very same collection, example -
>>> https://github.com/ansible-collections/arista.eos/blob/main/plugins/modules/eos_config.py#L319
>>> How does this path get resolved? Who adds ansible_collection to the
>>> PYTHONPATH?
>>> How do I make my python IDE to resolve that path during the developments
>>>
>>> Thank you, and appreciate your comments.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ansible-devel+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-devel/3e0a9a67-fbc0-44aa-846b-85772b710dbcn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-devel/3e0a9a67-fbc0-44aa-846b-85772b710dbcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Matt Martz
>> @sivel
>> sivel.net
>>
>

-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CAD8N0v90BtMQ_MURYCGD13UiMWxPSYuEWeL0%3Du1RjPn3Q%2BKNww%40mail.gmail.com.

Reply via email to