Skip to content
Schlomo Schapiro edited this page Aug 22, 2013 · 12 revisions

Motivation

  • Separation of concerns

    1. Service Packages bring their own minimal viable configuration
    2. Application Packages bring their additional dependencies (if needed)
    3. Host Configuration brings fine-tuning (if needed)
  • Reduce host-specific configuration, or: "Dont repeat yourself (or your configuration)"

Modularized Configuration Snippets

All *.yaml files in /etc/yadt.conf.d/ get merged

Structure of Host Configuration

  • dictionary of dictionaries, aka map of maps
services:
    fooservice:
    ...
settings:
    foo: bar

Rules for Merging Snippets

  1. Dictionaries get merged (recursivly).

  2. Lists gets concatenated.

  3. Scalars get overwritten (order of files matters here).

Example

Let's configure a host with a spring webapp. We want the webapp to run in the tomcat container, and tomcat itself will run behind a httpd webserver so that it can bind to port 80. We'll have the following packages installed at least :

  • A tomcat package, which should bring a snippet with
services:
    tomcat:
  • An httpd package, which should bring a snippet with
services:
    httpd:
  • A tomcat-with-httpd package, which should require both the tomcat and the httpd package, install some config to connect them and bring a snippet with
services:
    httpd:
        needs_services: [tomcat]
  • A my-webapp package with the actual webapp. This package only needs to require tomcat-with-httpd.
Clone this wiki locally