xivo-config configuration templating
Concept
Provided configs
dhcp
mail
provd
system
dialplan (xivo pbx & mds, new with NAOS)
Dialplan specifically is loaded to /usr/share/xivo-config/dialplan/asterisk, is checked after being loaded and can be configured on MDS and XiVO. The other confs work only on XiVO.
Behavior
On running xivo-update-config, the files from those directories will be thrown together and sent to the system directory where their configuration is applied. For files existing in both directory only the custom version will be taken.
root@xivo-naos:~# xivo-update-config
Generating configuration
(Re)templating
'dhcp' configuration OK, skipping.
'dialplan' configuration OK, skipping.
File asterisk/dirtyLeftover.conf lives outside the templated dialplan configuration
'mail' configuration OK, skipping.
'provd' configuration UPDATED.
'system' configuration OK, skipping.
(Re)configuring dahdi
(Re)configuring dhcp
DONE
Notes:
the build folder is temporary
xivo-update-config does not destroy anything. It’s up to you to clean the target of dirty/old config files
Variable replacement
To be detailed
Examples
Override existing dialplan conf
Copy/Create the file you want from the base templates folder to the custom template folder
mkdir -p /etc/xivo/custom-templates/dialplan/asterisk cp /usr/share/xivo-config/templates/dialplan/asterisk/extensions_lib_did.conf /etc/xivo/custom-templates/dialplan/asterisk/
Edit the file in custom-templates
Run xivo-update-config (dialplan will be reloaded)
The modified file is loaded to /usr/share/xivo-config/templates/asterisk/ & you can verify your modifications from asterisk cli
Override existing dhcp conf
Copy/Create the file you want from the base templates folder to the custom template folder
mkdir -p /etc/xivo/custom-templates/dhcp/etc/default/dhcp cp /usr/share/xivo-config/templates/dhcp/etc/default/dhcp/dhcp.conf /etc/xivo/custom-templates/dhcp/etc/default/dhcp/
Edit the file in custom-templates
Run xivo-update-config
The modified file is loaded to /etc/default/dhcp/dhcp.conf