To use the latest unreleased features, you can deploy the master branch of the Ansible role. This requires a custom directory structure to manage local roles and collections.
1. Setup Directory Structure
Create a directory (e.g., ~/openwisp-dev) with roles and collections subdirectories.
mkdir -p ~/openwisp-dev/roles
mkdir -p ~/openwisp-dev/collections
cd ~/openwisp-dev/
touch ansible.cfg requirements.yml hosts playbook.yml
2. Configure ansible.cfg
Set the paths for roles and collections in your ansible.cfg:
[defaults]
roles_path=~/openwisp-dev/roles
collections_paths=~/openwisp-dev/collections
3. Define Requirements
In requirements.yml, point to the OpenWISP Git repository and specify the master version:
---
roles:
- src: https://github.com/openwisp/ansible-openwisp2.git
version: master
name: openwisp.openwisp2-dev
collections:
- name: community.general
version: ">=3.6.0"
4. Install and Run
Install the requirements and run your playbook:
ansible-galaxy install -r requirements.yml
ansible-playbook -i hosts playbook.yml
Example Development Playbook:
- hosts: openwisp2
become: "{{ become | default('yes') }}"
roles:
- openwisp.openwisp2-dev
vars:
openwisp2_network_topology: true
openwisp2_firmware_upgrader: true
openwisp2_radius: true
openwisp2_monitoring: true
ansible-galaxy install -r requirements.yml
ansible-playbook -i hosts playbook.yml