Copy ml2_conf.ini to ODL hosts 59/53859/3
authorYifei Xue <xueyifei@huawei.com>
Thu, 15 Mar 2018 09:19:47 +0000 (17:19 +0800)
committerYifei Xue <xueyifei@huawei.com>
Fri, 16 Mar 2018 06:10:14 +0000 (14:10 +0800)
JIRA: -

SFC test cases in functest need to read ml2_conf.ini to get
ODL controller's IP and port. However they can only gei this file
from control nodes. So we copy this from neutron server containers
to ODL hosts.

Change-Id: I21acbaed6de924247d249d6c4015d9f90c763a08
Signed-off-by: Yifei Xue <xueyifei@huawei.com>
plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-servers-3.yml
plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-post.yml

index c4451ca..1eb6887 100755 (executable)
   become: "yes"
   become_user: "neutron"
   when: odl_sfc == "Enable"
+
+- name: fetch ml2_conf.ini to compass-tasks
+  fetch:
+    src: /etc/neutron/plugins/ml2/ml2_conf.ini
+    dest: /tmp/
+    flat: "yes"
+  when: odl_sfc == "Enable"
index 9f1cb79..55b0e16 100755 (executable)
 - name: restart opendaylight
   shell: sleep 60; service opendaylight restart; sleep 60;
   when: inventory_hostname in groups['network_hosts']
+
+- name: creat ml2 directory on ODL hosts
+  file:
+    path: /etc/neutron/plugins/ml2/
+    state: directory
+    mode: 0755
+  when:
+    - inventory_hostname in groups['network_hosts']
+    - odl_sfc == "Enable"
+
+- name: copy ml2_conf.ini to ODL hosts
+  copy:
+    src: /tmp/ml2_conf.ini
+    dest: /etc/neutron/plugins/ml2/ml2_conf.ini
+    mode: 0755
+  when:
+    - inventory_hostname in groups['network_hosts']
+    - odl_sfc == "Enable"