4. Configuration export

For persistent processing and routing of email, the configuration export function can export all domains, users, and settings from MSUI to a single YAML file (msui-config.yaml). This file will then be copied over to each Halon node to /etc/halon/msui-config.yaml using SCP. And finally it will compare both the source and destination file for any changes, and reload Halon’s configuration if necessary.

With the MSUI client plugin you can then import the YAML file into any HSL script, for more information check out the integration section.

Note

Ansible has to be installed on the same server running MSUI.

4.1. Configure MSUI

Below is an example of msui.yaml, with configuration export enabled. It will copy over the msui-config.yaml file to two Halon nodes.

servers:
  - id: default
    [...]
    app:
      configexport:
        enabled: true
        interval: 900
        nodes:
          - address: [email protected]
          - address: [email protected]

Upon installation of MSUI, a SSH key-pair will be generated and saved to the following paths:

  • /etc/halon/msui-export-ssh-key

  • /etc/halon/msui-export-ssh-key.pub

This key-pair will then be used for authentication by the configuration export function when coping over the msui-config.yaml file to each Halon node.

The /etc/halon/msui-export-ssh-key.pub needs to be added to each Halon node under the ~/.ssh/authorized_keys. In the example above it uses the halon user for authentication, the public key should then be added to this user’s authorized_keys file.

After the configuration has been saved MSUI will, using Ansible, try to export the msui-config.yaml file to the nodes specified in the config. The Ansible output from the logs will provide information stating which changes have been made:

PLAY RECAP *********************************************************************
[email protected] : ok=4 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[Configuration Export] 2024-06-13 09:35:32 Done after 2.55 seconds

4.2. Configuration export directives

servers[].app.configexport

The configuration export settings.

servers[].app.configexport.enabled

Enables or disables the export function (true or false).

servers[].app.configexport.interval

Set an interval (in seconds) how often the export should run (min 60 seconds).

servers[].app.configexport.nodes[]

A list of hosts that ansible will copy files to over SSH.

servers[].app.configexport.nodes[].address

The SSH address (eg. halon@10.0.0.1).

servers[].app.configexport.nodes[].args

Additional key-value arguments for ansible playbook.

Note

You can change the default destination path for each host by setting the remote_path argument.

- address: [email protected]
  args:
    "remote_path": "/new/path/halon/"