# create a working directory for ansible collections
mkdir ansible_collections
# checkout this repository to an appropriate location
git clone https://github.com/kmpm/ansible-collection-incus.git ansible_collection/kmpm/incus
# check out any other collections that we are depending upon
git clone https://github.com/ansible-collections/community.general.git ansible_collections/community/general
Create a ansible.cfg
that matches what you just cloned
[defaults]
collections_paths = ansible_collections
- https://www.redhat.com/sysadmin/ansible-dynamic-inventory-python
- https://www.redhat.com/sysadmin/ansible-plugin-inventory-files
- https://github.com/zestyping/q
- Medium - Guide to writing and debugging ansible modules in vscode
- GH - Sample Project for debugging with vscode
# Does ansible recognize the inventory plugin
$ ansible-doc -t inventory -l | grep incus
kmpm.incus.incus Incus inventory sou...
# Does it recognize the instance module
$ ansible-doc -t module -l | grep incus
kmpm.incus.incus_instance
ansible hostname -i inventory_source -m ansible.builtin.ping
First fix any format or similar errors
# to run it in docker
ansible-test sanity --docker default -v
# to run it locally with only single python version
ansible-test sanity --python 3.11 -v
# test with local venv
ansible-test units --venv --python 3.11
ansible-test integration --venv --python 3.11 unsupported/incus_instance