From cd02a03c60a0a86559b86644907dbcb6db551d18 Mon Sep 17 00:00:00 2001 From: Dimitrios Markou Date: Thu, 16 Nov 2017 12:32:49 +0200 Subject: [PATCH] Fix OVS manager configuration inconsistencies which are related to ODL 1. The 'neutron_services['neutron-server']['group']' returns a string which is not iterable thus we replaced this with 'groups[neutron_services['neutron-server']['group']]' to make the for loop functional again. 2. We replaced the 'container_address' key with the 'ansible_host' key to resolve the key missing problem which occured at the ODL gate due to the fact that we do not have a container_address variable to the tests/host_vars/server1.yml file. Change-Id: I4384ee1e6cd6c7f423ef4b2b5eedc1a05b3d9862 Signed-off-by: Dimitrios Markou --- vars/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index 2c037d54..4a594993 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -241,12 +241,10 @@ opendaylight_install_method: "{{ (ansible_os_family=='Debian') | ternary('deb_re ovs_manager_list: |- {% set ovs_managers_odls = [] %} - {% for host in neutron_services['neutron-server']['group'] %} - {% set odl_ip_address = hostvars[host]['container_address']|string %} - {% set _ = ovs_managers_odls.append('tcp:' + odl_ip_address + ':6640') %} - {% endfor %} + {% for odl_ip_address in groups[neutron_services['neutron-server']['group']] | map('extract', hostvars, 'ansible_host') | list -%} + {% set _ = ovs_managers_odls.append('tcp:' ~ odl_ip_address ~ ':6640') %} + {%- endfor %} {{ ovs_managers_odls | join(' ') }} - ### ### L3 Agent Plugin Configuration ###