Open sivel opened 2 months ago
cc @cidrblock
We currently have https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_creating.html - should we expand that documentation, or create something new, or both?
I'd be fine with extending that. As of now it leaves a lot to the reader.
@Andersson007 just Fyi ^^
Should we maybe ask the community to help here? via Bullhorn / community-wg post ? Speaking about ansible-dev-env, etc. i would mention it in seealso maybe but would limit the guide itself with only essential things like git and tools provided by ansible-core.
There have been numerous times where users have attempted to git clone a repo,
cd
into it, and attempt runningansible-playbook playbooks/some_playbook.yml
to test a collection. In this manner ansible-core has no context that the playbook is in a collection, nor will changes be made to core to support any attempted magic at doing so.This may be related to lack of documentation about common ways to develop collections, so we should expand on this further.
My typical approach generally revolves around isolation.
collections
directorygit clone
orinit
a collection repo into the proper directory structure ofcollections/<namespace>/<name>
Develop content in the project directory to manually develop the collection, this may involve creating a playbook like
runme.yml
which does something like which can be executed:Other mechanisms, such as that documented for
ansible-dev-environment
may be useful for the guide as well.I'm sure others may have ideas, but I generally recommend not using global collection dirs, nor using
ansible-galaxy collection install git+...
, and instead just directly interacting withgit
and proper directory structures thatansible-core
supports.