add tacker support 65/46465/1
authorYifei Xue <xueyifei@huawei.com>
Thu, 5 Oct 2017 09:42:34 +0000 (17:42 +0800)
committerYifei Xue <xueyifei@huawei.com>
Tue, 31 Oct 2017 08:54:06 +0000 (08:54 +0000)
JIRA: -

Add tacker support in compass euphrates. Upsteam OSA currently doesn't
support tacker in Ocata. But OPNFV needs to use tacker in SFC scenario.
So we refactor os_tacker of Pike to satisfy OpenStack Ocata.

Change-Id: I40bb90949d8cd3b9db166527b0d85ff42ad5cdb9
Signed-off-by: Yifei Xue <xueyifei@huawei.com>
(cherry picked from commit d0886a8dcf47ef0d27a0b7960dd152596f0a3a88)

deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/config-osa/files/op-venv-script.sh
deploy/adapters/ansible/roles/config-osa/tasks/main.yml
deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2
deploy/adapters/ansible/roles/config-osa/vars/main.yml
plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml [new file with mode: 0644]
plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-cluster.yml

index 3f58435..2e4afc0 100644 (file)
@@ -71,6 +71,7 @@
     - network_hosts
     - repo_container
     - utility
+    - tacker_all
   remote_user: root
   roles:
     - setup-odl-sfc
index c598027..fb19755 100644 (file)
@@ -201,6 +201,17 @@ unset ROLE_VENV_WITH_INDEX
 #unset ROLE_VENV_FILE
 #unset ROLE_VENV_WITH_INDEX
 
+ROLE_VENV_WITH_INDEX=false
+ROLE_VENV_PATH="/tmp/openstack-venv-builder/venvs/tacker"
+ROLE_VENV_FILE="tacker-15.1.4-x86_64"
+if [ ! -f "${ROLE_VENV_FILE}.tgz" ];then
+    venv_create "${ROLE_VENV_PATH}" "${ROLE_VENV_FILE}" "${ROLE_VENV_WITH_INDEX}" "python-tackerclient mysql-python networking-sfc==4.0.0 pymysql python-heatclient python-tackerclient tacker" &
+    pid[3]=$!
+fi
+unset ROLE_VENV_PATH
+unset ROLE_VENV_FILE
+unset ROLE_VENV_WITH_INDEX
+
 ROLE_VENV_WITH_INDEX=false
 ROLE_VENV_PATH="/tmp/openstack-venv-builder/venvs/horizon"
 ROLE_VENV_FILE="horizon-15.1.4-x86_64"
index edd1bc0..d96a83d 100755 (executable)
       {% endraw %}
   when: offline_deployment is defined and offline_deployment == "Enable"
 
+# This is a bug in ocata, will be removed in the future
+- name: limit the version of networking-sfc in os_tacker
+  shell: |
+    sed -i 's/networking-sfc$/networking-sfc=={{ networking_sfc_version }}/g' \
+        /etc/ansible/roles/os_tacker/defaults/main.yml
+
 - name: add rally and tempest to requirement.txt
   blockinfile:
     dest: /etc/ansible/roles/repo_build/tasks/repo_pre_build.yml
index cadf530..be119fb 100644 (file)
@@ -213,6 +213,13 @@ metrics_hosts:
     ip: {{ hostvars[host]['ansible_ssh_host'] }}
 {% endfor %}
 
+# tacker (mano service)
+mano_hosts:
+{% for host in groups.controller%}
+  {{host}}:
+    ip: {{ hostvars[host]['ansible_ssh_host'] }}
+{% endfor %}
+
 # nova hypervisors
 compute_hosts:
 {% for host in groups.compute%}
index 18687fa..0b3b0c1 100644 (file)
@@ -10,3 +10,4 @@
 LOCAL_REPOSITORY_IP: "192.168.137.222"
 ceph_host: "{{ hostvars[inventory_hostname]['groups']['ceph_osd'][0] }}"
 repo_dest_path: "/var/www/repo/os-releases/15.1.4/ubuntu-16.04-x86_64/"
+networking_sfc_version: 4.0.0
diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/control-tacker-1.yml
new file mode 100644 (file)
index 0000000..c43b6dc
--- /dev/null
@@ -0,0 +1,8 @@
+---
+
+- name: upgrade networking-sfc
+  pip:
+    name: networking-sfc
+    extra_args: -U
+    virtualenv: /openstack/venvs/tacker-15.1.4
+  when: odl_sfc == "Enable"
index 07bf708..ee2ee32 100755 (executable)
@@ -48,4 +48,7 @@
     - inventory_hostname in groups['neutron_server'][0]
     - inventory_hostname not in groups['network_hosts']
 
+- include: control-tacker-1.yml
+  when: inventory_hostname in groups['tacker_all']
+
 - include: odl-post.yml