Merge "Merge values for same key from multiple services"
This commit is contained in:
commit
542f9e00ab
@ -365,7 +365,10 @@ outputs:
|
|||||||
monitoring_subscriptions: {get_attr: [MonitoringSubscriptionsConfig, value]}
|
monitoring_subscriptions: {get_attr: [MonitoringSubscriptionsConfig, value]}
|
||||||
logging_sources: {get_attr: [LoggingSourcesConfig, value]}
|
logging_sources: {get_attr: [LoggingSourcesConfig, value]}
|
||||||
logging_groups: {get_attr: [LoggingGroupsConfig, value]}
|
logging_groups: {get_attr: [LoggingGroupsConfig, value]}
|
||||||
config_settings: {map_merge: {get_attr: [ServiceChain, role_data, config_settings]}}
|
config_settings:
|
||||||
|
yaql:
|
||||||
|
expression: $.data.where($ != null).reduce($1.mergeWith($2), {})
|
||||||
|
data: {get_attr: [ServiceChain, role_data, config_settings]}
|
||||||
global_config_settings: {get_attr: [GlobalConfigSettings, value]}
|
global_config_settings: {get_attr: [GlobalConfigSettings, value]}
|
||||||
service_config_settings: {get_attr: [ServiceConfigSettings, value]}
|
service_config_settings: {get_attr: [ServiceConfigSettings, value]}
|
||||||
workflow_tasks: {get_attr: [WorkflowTasks, value]}
|
workflow_tasks: {get_attr: [WorkflowTasks, value]}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
It is now possible to specify values for any key in `config_settings`
|
||||||
|
from multiple services; multiple values will be merged using YAQL
|
||||||
|
mergeWith() function. For example, assuming two services defining
|
||||||
|
a key as follows:
|
||||||
|
|
||||||
|
config_settings:
|
||||||
|
mykey:
|
||||||
|
- val1
|
||||||
|
|
||||||
|
config_settings:
|
||||||
|
mykey:
|
||||||
|
- val2
|
||||||
|
- val3
|
||||||
|
|
||||||
|
the content of the key, as seen by ansible or puppet on the nodes,
|
||||||
|
will be:
|
||||||
|
|
||||||
|
mykey: ['val1','val2','val3']
|
Loading…
Reference in New Issue
Block a user