Working on YAML-only blueprints I've hit a restriction where the only possible
configuration type that users can pass to my blueprint is a string. Anything
more complex gets its "toString()" method called and thus is impossible to
reconstruct cleanly on the bash side.
I suggest that we serialize complex objects to JSON before passing them as
environment variables to scripts. This will allow for blueprints like the
following:
brooklyn.catalog:
id: mapping-entity
item:
type: VanillaSoftwareProcess
env:
MAPPINGS: $brooklyn:config("mappings")
---
services:
- type: mapping-entity
brooklyn.config:
mappings:
key1: val1
key2: val2
---
On the bash side this results in an environment variable
MAPPINGS={"key1":"val1","key2":"val2"} which is easily manipulated with jq
binary.
I've implemented the change in
https://github.com/apache/brooklyn-server/pull/208
<https://github.com/apache/brooklyn-server/pull/208>.
Svet.