summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/post-osa
diff options
context:
space:
mode:
authorYifei Xue <xueyifei@huawei.com>2017-10-31 19:57:27 +0800
committerYifei Xue <xueyifei@huawei.com>2017-11-21 01:52:49 +0000
commit967ffc953d856673a7bb8a1f01c2eecc20242e31 (patch)
treeaa8e91d43cdb5f6a580daef6a503be8e03488ce3 /deploy/adapters/ansible/roles/post-osa
parent0ad92ba4a917893aa7897c225214afce955abfcc (diff)
Install networking-sfc for non odl-sfc scenarios
JIRA: - Currently we only install networking-sfc for odl-sfc scenario, however someone may use native neutron sfc functionality.So we propose this patch to add installation of networking-sfc for non odl scenarios. Change-Id: I4527387626f0c14fb6af135c511d0fd783b8f624 Signed-off-by: Yifei Xue <xueyifei@huawei.com> (cherry picked from commit 989d936c05c4f841efa383676473d2c6cc2cfba5)
Diffstat (limited to 'deploy/adapters/ansible/roles/post-osa')
-rwxr-xr-xdeploy/adapters/ansible/roles/post-osa/files/sfc.conf9
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml73
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/main.yml7
-rw-r--r--deploy/adapters/ansible/roles/post-osa/vars/main.yml5
4 files changed, 94 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/post-osa/files/sfc.conf b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf
new file mode 100755
index 00000000..ce42c9e1
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf
@@ -0,0 +1,9 @@
+[DEFAULT]
+
+service_plugins = router,metering,flow_classifier,sfc
+
+[sfc]
+drivers = ovs
+
+[flowclassifier]
+drivers = ovs
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
new file mode 100644
index 00000000..fbed5815
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
@@ -0,0 +1,73 @@
+---
+
+- name: install networking-sfc
+ pip:
+ name: networking-sfc
+ virtualenv: /openstack/venvs/neutron-15.1.4
+ when:
+ - inventory_hostname in groups['neutron_server']
+
+- name: install crudini
+ 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']
+
+- name: turn off neutron-server on control node
+ service: name=neutron-server state=stopped
+ when: inventory_hostname in groups['neutron_server']
+
+- name: copy sfc.conf
+ copy:
+ src: "{{ sfc_plugins.src }}"
+ dest: "{{ sfc_plugins.dst }}"
+ mode: 0755
+ when: inventory_hostname in groups['neutron_server']
+
+- name: Configure SFC driver
+ shell: crudini --merge /etc/neutron/neutron.conf < /opt/sfc.conf
+ when: inventory_hostname in groups['neutron_server']
+
+- name: delete sfc.conf
+ shell: rm -rf {{ sfc_plugins.dst }}
+ when: inventory_hostname in groups['neutron_server']
+
+- name: Perform a Neutron DB online upgrade
+ command: |
+ /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ --config-file /etc/neutron/neutron.conf
+ --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
+ upgrade --expand
+ become: "yes"
+ become_user: "neutron"
+ when: inventory_hostname in groups['neutron_server'][0]
+
+- name: Perform a Neutron DB offline upgrade
+ command: |
+ /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ --config-file /etc/neutron/neutron.conf
+ --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
+ upgrade --contract
+ become: "yes"
+ become_user: "neutron"
+ when: inventory_hostname in groups['neutron_server'][0]
+
+- name: SFC DB upgrade
+ command: |
+ /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ --subproject networking-sfc
+ upgrade head
+ become: "yes"
+ become_user: "neutron"
+ when: inventory_hostname in groups['neutron_server'][0]
+
+- name: turn on neutron-server on control node
+ service: name=neutron-server state=started
+ 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 c48a5d1a..f7f7a6cc 100644
--- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
@@ -8,3 +8,10 @@
##############################################################################
---
- include: "{{ ansible_distribution }}.yml"
+ when: inventory_hostname in groups['compute']
+
+# install networking-sfc for non odl scenarios
+- include: install_networking_sfc.yml
+ when:
+ - odl_sfc is not defined or odl_sfc == "Disable"
+ - inventory_hostname not in groups['compute']
diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
new file mode 100644
index 00000000..4feb9756
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
@@ -0,0 +1,5 @@
+---
+
+sfc_plugins:
+ src: sfc.conf
+ dst: /opt/sfc.conf