-
Notifications
You must be signed in to change notification settings - Fork 7
Host Configuration
Schlomo Schapiro edited this page Aug 22, 2013
·
12 revisions
-
Separation of concerns
- Service Packages bring their own minimal viable configuration
- Application Packages bring their additional dependencies (if needed)
- Host Configuration brings fine-tuning (if needed)
-
Reduce host-specific configuration, or: "Dont repeat yourself (or your configuration)"
All *.yaml
files in /etc/yadt.conf.d/
get merged
- dictionary of dictionaries, aka map of maps
services:
fooservice:
...
settings:
foo: bar
-
Dictionaries get merged (recursivly).
-
Lists gets concatenated.
-
Scalars get overwritten (order of files matters here).
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 and will probably bring some additional config for httpd and/or tomcat. It can also modify the existing service definition, e.g. to declare which is the front service:
services:
httpd:
is_frontservice: true