From 4217767d8782abae02b11f553fc14daf7cd72916 Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Fri, 20 Oct 2017 23:27:15 +0100 Subject: Refactor cellv2 host discovery logic to avoid races The compute service list is polled until all expected hosts are reported or a timeout occurs (600s). Adds a cellv2_discovery flag to puppet services. Used to generate a list of hosts that should have cellv2 host mappings. Adds a canonical fqdn and that should match the fqdn reported by a host. Adds the ability to upload a config script for docker config instead of using complex bash on-liners. Closes-bug: 1720821 Change-Id: I33e2f296526c957cb5f96dff19682a4e60c6a0f0 (cherry picked from commit 61fcfca045aeb5be1ee280d8dd9c260fb39b9084) --- overcloud.j2.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'overcloud.j2.yaml') diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index 3506fe8e..9ea195da 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -642,6 +642,21 @@ resources: {% for role in roles %} - {get_attr: [{{role.name}}ServiceNames, value]} {% endfor %} + cellv2_discovery_hosts: + # Collects compute hostnames for all roles with a service that requires cellv2 host discovery + list_join: + - ',' + - yaql: + expression: coalesce($.data.e.zip($.data.l).where($[0]).select($[1]).flatten(), []) + data: + e: # list of true/fails for whether cellsv2 host discovery is required for the roles +{%- for role in roles %} + - {get_attr: [{{role.name}}ServiceChainRoleData, value, cellv2_discovery]} +{%- endfor %} + l: # list of list of compute hostnames for the roles +{%- for role in roles %} + - {get_attr: [{{role.name}}, hostname_map, canonical]} +{%- endfor %} controller_ips: {get_attr: [{{primary_role_name}}, ip_address]} controller_names: {get_attr: [{{primary_role_name}}, hostname]} service_ips: -- cgit 1.2.3-korg