Merge "Do not generate apache/haproxy certs for invalid networks"

This commit is contained in:
Zuul 2018-02-08 23:15:21 +00:00 committed by Gerrit Code Review
commit 5f49e090e3
3 changed files with 12 additions and 19 deletions

View File

@ -61,10 +61,12 @@ resources:
# NOTE(jaosorior) Get unique network names to create # NOTE(jaosorior) Get unique network names to create
# certificates for those. We skip the tenant network since # certificates for those. We skip the tenant network since
# we don't need a certificate for that. # we don't need a certificate for that.
yaql: - ctlplane
expression: list($.data.values().toSet().where($ != tenant)) {%- for network in networks %}
data: {%- if network.name_lower != 'tenant' %}
get_param: ServiceNetMap - {{network.name_lower}}
{%- endif %}
{%- endfor %}
outputs: outputs:
role_data: role_data:

View File

@ -47,11 +47,12 @@ resources:
# certificates for those. We skip the tenant network since # certificates for those. We skip the tenant network since
# we don't need a certificate for that, and the external # we don't need a certificate for that, and the external
# network will be handled in another template. # network will be handled in another template.
yaql: - ctlplane
expression: list($.data.map.items().map($1[1])).distinct().where($ != external and $ != tenant) {%- for network in networks if network.vip|default(false) %}
data: {%- if network.name_lower != 'external' and network.name_lower != 'tenant' %}
map: - {{network.name_lower}}
get_param: ServiceNetMap {%- endif %}
{%- endfor %}
outputs: outputs:
role_data: role_data:

View File

@ -33,13 +33,3 @@ class YAQLTestCase(base.BaseTestCase):
data = data[i] data = data[i]
return data['yaql']['expression'] return data['yaql']['expression']
def test_apache_networks(self):
snippet = self.get_snippet(
'puppet/services/apache.yaml',
'resources.ApacheNetworks.properties.value')
self.assertEqual(
['service'],
yaql.eval(
snippet,
{'data': {'nova': 'tenant', 'cinder': 'service',
'glance': 'service'}}))