From d0f85e3fe5bd25f95ecd3022e1da376b74b2bdb1 Mon Sep 17 00:00:00 2001
From: Sylvain Baubeau <sbaubeau@redhat.com>
Date: Tue, 3 Jul 2018 16:21:17 +0200
Subject: [PATCH] Skydive: Update Keystone and Neutron configuration

Skydive recently splitted the OpenStack configuration:
one for the authentication - on the analyzer - 'auth.keystone'
and an other one for the Neutron probe on the agent
'agent.topology.neutron'.

Change-Id: Idce277d30f01e7a36499b1aee24c54779c54a807
---
 .../skydive/templates/skydive-agent.conf.j2   | 19 +++++++++----------
 .../templates/skydive-analyzer.conf.j2        | 12 +++++-------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/ansible/roles/skydive/templates/skydive-agent.conf.j2 b/ansible/roles/skydive/templates/skydive-agent.conf.j2
index a65bac7df5..8daa53549b 100644
--- a/ansible/roles/skydive/templates/skydive-agent.conf.j2
+++ b/ansible/roles/skydive/templates/skydive-agent.conf.j2
@@ -1,7 +1,6 @@
 ### Skydive agent config file
 
 auth:
-  type: keystone
   analyzer_username: {{ openstack_auth['username'] }}
   analyzer_password: {{ openstack_auth['password'] }}
 
@@ -12,15 +11,6 @@ logging:
   file:
     path: /var/log/kolla/skydive/skydive-agent.log
 
-openstack:
-  auth_url: {{ keystone_internal_url }}/v3
-  username: {{ openstack_auth['username'] }}
-  password: {{ openstack_auth['password'] }}
-  tenant_name: {{ openstack_auth['project_name'] }}
-  region_name: {{ openstack_region_name }}
-  domain_name: Default
-  endpoint_type: internal
-
 etcd:
   servers:
 {% if enable_etcd | bool %}
@@ -55,6 +45,15 @@ agent:
       - ovsdb
 {% endif %}
 
+    neutron:
+      auth_url: {{ keystone_internal_url }}/v3
+      username: {{ openstack_auth['username'] }}
+      password: {{ openstack_auth['password'] }}
+      tenant_name: {{ openstack_auth['project_name'] }}
+      region_name: {{ openstack_region_name }}
+      domain_name: Default
+      endpoint_type: internal
+
 netns:
   run_path: /host/run
 
diff --git a/ansible/roles/skydive/templates/skydive-analyzer.conf.j2 b/ansible/roles/skydive/templates/skydive-analyzer.conf.j2
index ddcf3c3759..c19ab0ec2e 100644
--- a/ansible/roles/skydive/templates/skydive-analyzer.conf.j2
+++ b/ansible/roles/skydive/templates/skydive-analyzer.conf.j2
@@ -5,6 +5,11 @@ auth:
   analyzer_username: {{ openstack_auth['username'] }}
   analyzer_password: {{ openstack_auth['password'] }}
 
+  keystone:
+    auth_url: {{ keystone_internal_url }}/v3
+    region_name: {{ openstack_region_name }}
+    domain_name: Default
+
 logging:
   level: INFO
   backends:
@@ -12,13 +17,6 @@ logging:
   file:
     path: /var/log/kolla/skydive/skydive-analyzer.log
 
-openstack:
-  auth_url: {{ keystone_internal_url }}/v3
-  tenant_name: {{ openstack_auth['project_name'] }}
-  region_name: {{ openstack_region_name }}
-  domain_name: Default
-  endpoint_type: internal
-
 analyzers:
 {% for host in groups['skydive-analyzer'] %}
   - {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ skydive_analyzer_port }}