Hi all,

as everyone on this list should know, openwisp historically has always
worked with a pull approach: devices constantly check and pull
configuration updates.
Since implementing a configuration agent on every system we want to support
it's not feasible both for technical limitations and costs, I've started
experimenting with the opposite approach: enabling openwisp2 to send
configuration updates directly to devices, for the moment I called this
feature "connectors"
<https://github.com/openwisp/openwisp-controller/tree/connectors>.

I have prepared a prototype that we can start playing with in order to test
configuration updates on the new experimental backends (AirOS and Raspbian).
Doing this kind of work will help us to understand important things:

   - how to improve the experimental backends so to make them readier for
   production usage
   - how to improve the prototype and openwisp2 in general in order to
   implement this feature properly

In order to test the prototype, here's the instructions:

   - clone this module from git:
   https://github.com/openwisp/openwisp-controller
   - go to the connectors branch
   - first of all, in your python virtualenv, run this command: pip install
   https://github.com/nemesisdesign/scp.py/tarball/master
   - then follow these instructions:
   
https://github.com/openwisp/openwisp-controller/tree/connectors#installing-for-development
   - log into the admin
   - create a connector object, select the class type you need (OpenWRT,
   AIrOS, Raspbian), then in the params section add this JSON string:
   {"username": "root", "password": "root"}, substitute username and password
   with what you are using
   - then create a device object for the device you want to test and
   prepare its configuration (if you have a NetJSON configuration ready, paste
   it into the advanced mode)
   - add the device ip
   - add a DeviceConnector object, specify which connector to use, leave
   the params field empty
   - save
   - from now on each time you save the application will try to connect to
   the device and perform the push operation

You can find the push operations in the current prototype here:

   - AirOS:
   
https://github.com/openwisp/openwisp-controller/blob/connectors/openwisp_controller/connectors/airos/ssh.py
   - Raspbian:
   
https://github.com/openwisp/openwisp-controller/blob/connectors/openwisp_controller/connectors/raspbian/ssh.py
   - OpenWRT/LEDE (requires the openwisp-config daemon):
   
https://github.com/openwisp/openwisp-controller/blob/connectors/openwisp_controller/connectors/openwrt/ssh.py

Have fun!

Federico

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to