-
Notifications
You must be signed in to change notification settings - Fork 528
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
Add a guide page that explains various mechanisms for developing a collection #1952
Comments
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 ? |
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.
Create a project directory
inside that project directory create a
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.The text was updated successfully, but these errors were encountered: