Jump to heading Inheritance
Sometimes it make sense to extend an existing configuration or to include configuration from other places from the file-system or from remote locations. There's a special key
inheritsFrom which will include the yaml found at the location and merge it with the data. This is supported for entries in
dockerHosts and for the fabfile itself.
dockerHost or the fabfile itself has the key
inheritsFrom, then the given key is used as a base-configuration. Here's a simple example:
example1 will store the merged configuration from
default with the configuration of
example2 is a merge of all three configurations:
You can even reference external files to inherit from:
This mechanism works also for the fabfile.yaml / index.yaml itself, and is not limited to one entry:
name: test fabfile
Jump to heading Inherit from a blueprint
You can even inherit from a blueprint configuration for a host-config. This host-config can then override specific parts.
host: demo: inheritFromBlueprint: config: my-blueprint-config varian: the-variant
Jump to heading Inherit a blueprint from an existing blueprint
inheritsFrom is not supported for blueprints, they will be resolved after the config got created. But you can use
blueprintInheritsFrom instead. An example:
dockerHosts: hostA: blueprint: key: hello-world hosts: hostA: blueprint: blueprintInheritsFrom: - docker:hostA hostB: blueprint: blueprintInheritsFrom: - host:hostA
As blueprints can be part of the general section, a dockerHost-confg or a host config, they need a namespace, so phab knows exactly which blueprint config you want to inherit from.