aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifei Xue <xueyifei@huawei.com>2017-12-04 15:59:55 +0800
committerYifei Xue <xueyifei@huawei.com>2017-12-04 15:59:55 +0800
commitcc4d6db7534c509797aa363acc3c27f8c8cfecca (patch)
tree3bd1712094a7808091eff6a7b53406a14ca5ecd2
parent8a50c8b9bfc532494eb89641cee000dd60f8c0f9 (diff)
Enable tacker horizon
JIRA: - 1 - Enable tacker horizon 2 - Open SFC extension on compute nodes Change-Id: I7d6ea0db78dc529e3d7f8bd1a44a3c0de76aac22 Signed-off-by: Yifei Xue <xueyifei@huawei.com>
-rw-r--r--deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml1
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml9
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/main.yml5
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml33
-rw-r--r--deploy/adapters/ansible/roles/post-osa/vars/main.yml9
5 files changed, 53 insertions, 4 deletions
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
index 8d944387..ffe07496 100644
--- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
+++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
@@ -45,6 +45,7 @@
- compute
- utility
- neutron_server
+ - horizon_all
remote_user: root
roles:
- post-osa
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
index fbed5815..2340bc5f 100644
--- a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
@@ -11,14 +11,12 @@
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
@@ -35,6 +33,11 @@
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']
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
index f7f7a6cc..721114e2 100644
--- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
@@ -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
index 00000000..2c1d2d87
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml
@@ -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
diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
index 4feb9756..e4d216f7 100644
--- a/deploy/adapters/ansible/roles/post-osa/vars/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
@@ -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