Enable tacker horizon 99/48299/1
authorYifei Xue <xueyifei@huawei.com>
Mon, 4 Dec 2017 07:59:55 +0000 (15:59 +0800)
committerYifei Xue <xueyifei@huawei.com>
Mon, 4 Dec 2017 07:59:55 +0000 (15:59 +0800)
JIRA: -

1 - Enable tacker horizon
2 - Open SFC extension on compute nodes

Change-Id: I7d6ea0db78dc529e3d7f8bd1a44a3c0de76aac22
Signed-off-by: Yifei Xue <xueyifei@huawei.com>
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
deploy/adapters/ansible/roles/post-osa/tasks/main.yml
deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml [new file with mode: 0644]
deploy/adapters/ansible/roles/post-osa/vars/main.yml

index 8d94438..ffe0749 100644 (file)
@@ -45,6 +45,7 @@
     - compute
     - utility
     - neutron_server
+    - horizon_all
   remote_user: root
   roles:
     - post-osa
index fbed581..2340bc5 100644 (file)
   package:
     name: crudini
     state: latest
-  when:
-    - inventory_hostname in groups['neutron_server']
 
 - name: Install networking-sfc for CLI
   pip:
     name: networking-sfc
   when:
-    - inventory_hostname in groups['utility']
+    - inventory_hostname not in groups['neutron_server']
 
 - name: turn off neutron-server on control node
   service: name=neutron-server state=stopped
   shell: crudini --merge /etc/neutron/neutron.conf < /opt/sfc.conf
   when: inventory_hostname in groups['neutron_server']
 
+- name: Configure SFC extension on compute nodes
+  shell: crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini \
+             agent extensions sfc;
+  when: inventory_hostname in groups['compute']
+
 - name: delete sfc.conf
   shell: rm -rf {{ sfc_plugins.dst }}
   when: inventory_hostname in groups['neutron_server']
index f7f7a6c..721114e 100644 (file)
@@ -14,4 +14,7 @@
 - include: install_networking_sfc.yml
   when:
     - odl_sfc is not defined or odl_sfc == "Disable"
-    - inventory_hostname not in groups['compute']
+    - inventory_hostname not in groups['horizon_all']
+
+- include: tacker_horizon.yml
+  when: inventory_hostname in groups['horizon_all']
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml
new file mode 100644 (file)
index 0000000..2c1d2d8
--- /dev/null
@@ -0,0 +1,33 @@
+---
+
+- name: remove tacker-horizon directory
+  file:
+    path: "{{ tacker_horizon_dir }}"
+    state: absent
+
+- name: get tacker horizon (online)
+  git:
+    repo: "{{ tacker_horizon_repo }}"
+    dest: "{{ tacker_horizon_dir }}"
+    version: "{{ tacker_horizon_branch }}"
+  when: offline_deployment is defined and offline_deployment == "Disable"
+
+- name: copy installation script (offline)
+  get_url:
+    url: "http://{{ offline_repo_ip }}:{{ offline_repo_port }}/tacker-horizon.tar.gz"
+    dest: "/opt/"
+  when: offline_deployment is defined and offline_deployment == "Enable"
+
+- name: untar tacker-horizon tarball
+  command: su -s /bin/sh -c "tar xzf /opt/tacker-horizon.tar.gz -C /opt/"
+  when: offline_deployment is defined and offline_deployment == "Enable"
+
+- name: install tacker-horizon
+  shell: |
+    cd /opt/tacker-horizon/;
+    pip install -r requirements.txt;
+    sleep 30;
+    python setup.py install;
+    cp tacker_horizon/enabled/* \
+       {{ tacker_horizon_enable_path }}/;
+    service apache2 restart
index 4feb975..e4d216f 100644 (file)
@@ -3,3 +3,12 @@
 sfc_plugins:
   src: sfc.conf
   dst: /opt/sfc.conf
+
+# yamllint disable rule:line-length
+tacker_horizon_repo: https://github.com/openstack/tacker-horizon.git
+tacker_horizon_dir: /opt/tacker-horizon
+tacker_horizon_branch: stable/ocata
+openstack_release: 15.1.4
+tacker_horizon_venv: "/openstack/venvs/horizon-{{ openstack_release }}"
+tacker_horizon_enable_path: "{{ tacker_horizon_venv }}/lib/python2.7/site-packages/openstack_dashboard/enabled"
+# yamllint enable rule:line-length