Changes

no edit summary
Line 1: Line 1: −
The mace is a tool to ma<strike>c</strike>ke final configuration using source templates. Sources for {{Code|mace}} are stored in GNU/Linux distribution agnostic manner in form of:
+
The mace is a tool to ma<strike>c</strike>ke final configuration using source templates. Mace is supposed to help with configuration of services on Server based school servers.
 +
 
 +
The core differences with tools like Puppet or Cfengine:
 +
 
 +
* mace doesn't provide new metaphors, people need to follow the same configuration syntax for particular services;
 +
* mace is not intended to be an unified system like Puppet or Cfenginei, it supports only limited set of services (what Server based solution provides) but does it well, e.g., for iptables just write rules and the rest will be done by mace;
 +
* mace doesn't function like a daemon, it just converts configuration sources to the final configuration on the final server, e.g., as a post procedure after installing packages;
 +
* mace is designed to support intermediate customizing, i.e., the original configuration, provided by upstream project, might be supplemented (not patched) in downstream product before deploying to the final users.
 +
 
 +
== Configuration sources ==
 +
 
 +
Sources for {{Code|mace}} are stored in GNU/Linux distribution agnostic manner in form of:
    
  [<arbitrary-path>]/<service-name>.d/[<service-confile>]/<configuration-file>.conf
 
  [<arbitrary-path>]/<service-name>.d/[<service-confile>]/<configuration-file>.conf
Line 26: Line 37:  
  <config>    |    +0110.addons.conf
 
  <config>    |    +0110.addons.conf
 
  <empty>    +0300.proxy
 
  <empty>    +0300.proxy
 +
 +
See [http://git.sugarlabs.org/server/base/trees/master/etc sugar-server-base sources] for more complex example.
 +
 +
== Configuration applying ==
 +
 +
Having configuration sources tree, mace will apply it to the real system by doing:
 +
 +
# walk through the sources tree to collect all configuration source files for each supported service;
 +
# apply particular service configuration by saving files, the backup copies will be kept;
 +
# ask mace provider of particular service to make sure that everything, related to this services, is good, e.g., check if Prosody SSL keys/certificates exist and not expired or if Squid's swap is created;
 +
# if new configuration is different to previous one or if 3) changed something in the system, restart this service;
 +
# make sure if service will be started at boot time;
 +
# if all previous steps aborted due to fails, revert original configuration.
 +
 +
== Testing routines ==
 +
 +
Before applying configuration on real system, it might be done to the temporary directory (do not forget about {{Code|--dry-services}} argument to not restart services):
 +
 +
mace apply -o /tmp/test -S
 +
 +
Mace also supports several listing commands that just walk though the sources tree and print useful information about it:
 +
 +
* {{Code|mace ls}}, list sources status for particular directory;
 +
* {{Code|mace dirs}}, list sources status by services;
 +
* {{Code|mace show}}, interpret services status given by {{Code|mace dirs}} command;
 +
* {{Code|mace files}}, list all configuration files.
 +
 +
The status legend is:
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! scope="col" | '''Symbol'''
 +
! scope="col" | '''Note'''
 +
|-
 +
| {{Code|-}}
 +
| there are configuration files
 +
|-
 +
| {{Code|*}}
 +
| there are several configuration files for the service that will be merged to the same final configuration file
 +
|-
 +
| {{Code|o}}
 +
| some of configuration files are overridden by files with the same name but from different directory
 +
|-
 +
| {{Code|O}}
 +
| all configuration files are overridden by files with the same name but from different directory
 +
|-
 +
| {{Code|h}}
 +
| some of configuration files are hidden by empty files with the same name but from different directory
 +
|-
 +
| {{Code|H}}
 +
| all configuration files are hidden by empty files with the same name but from different directory
 +
|-
 +
|}