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
# certificates for those. We skip the tenant network since
# we don't need a certificate for that.
yaql:
expression: list($.data.values().toSet().where($ != tenant))
data:
get_param: ServiceNetMap
- ctlplane
{%- for network in networks %}
{%- if network.name_lower != 'tenant' %}
- {{network.name_lower}}
{%- endif %}
{%- endfor %}
outputs:
role_data:

View File

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

View File

@ -33,13 +33,3 @@ class YAQLTestCase(base.BaseTestCase):
data = data[i]
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'}}))