From dd141c87e0c5ca38b727760d70fa2956d83d03b2 Mon Sep 17 00:00:00 2001 From: ramamani yeleswarapu Date: Wed, 1 Aug 2018 18:23:01 -0700 Subject: [stor4nfv] Add os-stor4nfv role for OpenStack deploy Adds os-stor4nfv role for OpenStack deploy which installs OpenSDS and Cindercompatibleapi. Disables Cinder service and configures cindercompatibleapi to work with 'lvm' backend. Adds os-nosdn-stor4nfv-ha scenario file. Adds os-nosdn-stor4nfv-noha scenario file. Change-Id: Ie4b6a874beb3f61aa2fd08ebc6c97ab737c012ee Signed-off-by: ramamani yeleswarapu --- .../stor4nfv/roles/os-stor4nfv/tasks/opensds.yml | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml (limited to 'plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml') diff --git a/plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml new file mode 100644 index 00000000..2d0f05cc --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/tasks/opensds.yml @@ -0,0 +1,72 @@ +# ############################################################################# +# Copyright (c) 2018 Intel Corp. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- + +- name: install prerequisites package + apt: + name: "{{ item }}" + state: present + with_items: + - git + - gawk + - curl + - wget + - software-properties-common + +- name: copy install_ansible script + remote_user: root + copy: + src: install_ansible.sh + dest: /opt/install_ansible.sh + mode: 0777 + +- name: install ansible + command: su -s /bin/sh -c "/opt/install_ansible.sh" + ignore_errors: "true" + +- name: disable cinder + remote_user: root + shell: | + lxc-stop -n $(lxc-ls --line | grep cinder_api) + lxc-stop -n $(lxc-ls --line | grep cinder_scheduler) + ignore_errors: "true" + +- name: modify haproxy.cfg and restart haproxy + remote_user: root + shell: | + sed -i \ + '/frontend cinder_api-front/,/host1_cinder_api_container/ s/^/#/' /etc/haproxy/haproxy.cfg + systemctl restart haproxy + ignore_errors: "true" + +- name: fetch stor4nfv source code + remote_user: root + shell: | + mkdir -p $HOME/gopath/src/github.com/os-stor4nfv && cd $HOME/gopath/src/github.com/os-stor4nfv; + rm -rf stor4nfv; + git clone https://gerrit.opnfv.org/gerrit/stor4nfv.git + +- name: copy os_configure_vars script + remote_user: root + copy: + src: os_configure_vars.sh + dest: /opt/os_configure_vars.sh + mode: 0777 + +- name: configure variables for opensds + remote_user: root + shell: | + cd /opt; + ./os_configure_vars.sh {{ public_vip.ip }} + +- name: run playbook + remote_user: root + shell: | + cd $HOME/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible; + ansible-playbook site.yml -i local.hosts | tee /var/log/os-stor4nfv.log -- cgit 1.2.3-korg