Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 2.09 KB

DEVELOP.md

File metadata and controls

77 lines (53 loc) · 2.09 KB

Developing the collection

# 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

Recommended reading

If you are using vscode

Testing

Using ansible-doc

# 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 

Simple execution

ansible hostname -i inventory_source -m ansible.builtin.ping

Sanity

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

Unit and integration

# test with local venv
ansible-test units --venv --python 3.11

ansible-test integration --venv --python 3.11 unsupported/incus_instance

Links