diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-09-09 07:46:08 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-09-09 07:46:08 +0000 |
commit | 27c38e3784973ce368e1213daef0061a5f8ae503 (patch) | |
tree | 7312bf7eb90e06f4c02b9da40e4c24ff24840266 | |
parent | 0f3249df2b68ff426a6aff6ccd8981747e234586 (diff) | |
parent | 393c15550a7416486daaaf4584cda50ee99fd790 (diff) |
Merge "Add service networks to hieradata"
-rw-r--r-- | puppet/all-nodes-config.yaml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/puppet/all-nodes-config.yaml b/puppet/all-nodes-config.yaml index 69bb1935..2ef30005 100644 --- a/puppet/all-nodes-config.yaml +++ b/puppet/all-nodes-config.yaml @@ -90,6 +90,28 @@ resources: for_each: SERVICE: str_split: [',', {get_param: enabled_services}] + # Dynamically generate per-service network data + # This works as follows (outer->inner functions) + # yaql - filters services where no mapping exists in ServiceNetMap + # map_replace: substitute e.g heat_api_network with network name from ServiceNetMap + # map_merge/repeat: generate a per-service mapping + - yaql: + # This filters any entries where the value hasn't been substituted for + # a list, e.g it's still $service_network. This happens when there is + # no network defined for the service in the ServiceNetMap, which is OK + # as not all services have to be bound to a network, so we filter them + expression: dict($.data.map.items().where(isString($[1]) and not $[1].endsWith("_network"))) + data: + map: + map_replace: + - map_merge: + repeat: + template: + SERVICE_network: SERVICE_network + for_each: + SERVICE: + str_split: [',', {get_param: enabled_services}] + - values: {get_param: ServiceNetMap} # provides a mapping of service_name_ips to a list of IPs - {get_param: service_ips} - {get_param: service_node_names} |