Skip to content

Commit

Permalink
Added "Unmanaged Configurations" instructions to README #16
Browse files Browse the repository at this point in the history
Removed deprecated "Default Configuration"; closes #16
  • Loading branch information
nemesifier committed Mar 4, 2016
1 parent 133c999 commit 2941f49
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ UCI configuration options must go in ``/etc/config/openwisp``.
- ``uuid``: unique identifier of the router configuration in the controller application
- ``key``: key required to download the configuration
- ``shared_secret``: shared secret, needed for `Automatic registration`_
- ``merge_default``: list of default configuration files that must be kept, see `Default Configuration`_
- ``unmanaged``: list of config sections which won't be overwritten, see `Unmanaged Configurations`_
- ``test_config``: whether a new configuration must be tested before being considered applied, defaults to ``1``
- ``test_script``: custom test script, read more about this feature in `Configuration test`_

Expand Down Expand Up @@ -101,39 +101,41 @@ If the default test does not satisfy your needs, you can define your own tests i

If the exit code of the executable script is higher than ``0`` the test will be considered failed.

Default Configuration
---------------------
Unmanaged Configurations
------------------------

In some cases it is necessary to ensure that some configuration files won't be
In some cases it is necessary to ensure that some configuration sections won't be
overwritten by the controller.

These configuration files will be backed up the first time the agent will be able
to contact the controller (which means it will have a basic working configuration.) and
from then on they will be merged in after the configuration is downloaded and applied.

This also allows you to avoid to define a lot of boilerplate configuration in the controller,
think about LED settings, switch directives, NTP configuration and so on.
This brings two main advantages:

When *openwisp-config* is installed the following packages are listed in ``merge_default``:
- it frees you from defining a lot of boilerplate configuration in the controller,
think about LED settings, switch directives, NTP configuration and so on
- it allows you to define settings that can be managed manually via luci/SSH when needed,
think about a user wanting to change its LAN ip settings from dhcp to a precise static address

* ``system``
* ``network``

Eg::
These are the default unmanaged settings::

config controller 'http'
...
list merge_default 'system'
list merge_default 'network'
list unmanaged 'system.ntp'
list unmanaged 'system.@led'
list unmanaged 'network.loopback'
list unmanaged 'network.globals'
list unmanaged 'network.lan'
list unmanaged 'network.wan'
list unmanaged 'network.@switch'
list unmanaged 'network.@switch_vlan'
...

The ``system`` config file is treated in a special way: ``hostname`` and ``timezone`` are
removed because they are always automatically generated by the controller.
Note the lines with the `@` sign; that syntax means that any UCI section of that type will be unmanaged.

All the other lines refer to precise named UCI settings, eg: ``network.lan`` refers to the LAN interface.

Disable default configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Disable Unmanaged Configurations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To disable this feature, just remove all the ``merge_default`` options.
To disable unmanaged configurations simply remove all the ``unmanaged`` options.

Compiling openwisp-config
-------------------------
Expand Down

0 comments on commit 2941f49

Please sign in to comment.