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 --- .../roles/os-stor4nfv/tasks/post-install.yml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml (limited to 'plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml') diff --git a/plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml b/plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml new file mode 100644 index 00000000..c549566a --- /dev/null +++ b/plugins/stor4nfv/roles/os-stor4nfv/tasks/post-install.yml @@ -0,0 +1,78 @@ +# ############################################################################# +# 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: ensure opensds.conf exists + stat: + path: /etc/opensds/opensds.conf + ignore_errors: "true" + register: opensds_exists + +- name: configure ceph.yaml, opensds.conf + remote_user: root + shell: | + cd /root/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible + cp group_vars/ceph/ceph.yaml /etc/opensds/driver/ + + sed -i 's/^ enabled_backends.*/ enabled_backends: ceph/g' /etc/opensds/opensds.conf + + sudo cat >> /etc/opensds/opensds.conf << OPENSDS_GLOABL_CONFIG_DOC + + [ceph] + name = ceph + description = Ceph Test + driver_name = ceph + config_path = /etc/opensds/driver/ceph.yaml + OPENSDS_GLOABL_CONFIG_DOC + when: + - opensds_exists.stat.exists + +- name: copy ceph.conf from ceph-mon container + remote_user: root + shell: | + mkdir -p /etc/ceph + cp /proc/$(lxc-info -n $(lxc-ls --line | grep ceph-mon) -p -H)/root/etc/ceph/ceph.conf \ + /etc/ceph/ceph.conf + when: + - opensds_exists.stat.exists + +- name: ensure osdsdock exists + stat: + path: /opt/opensds-hotpot-linux-amd64/bin/osdsdock + ignore_errors: "true" + register: osdsdock_exists + +- name: start osdsdock daemon + remote_user: root + shell: | + /opt/opensds-hotpot-linux-amd64/bin/osdsdock -daemon + ignore_errors: "true" + when: + - osdsdock_exists.stat.exists + +- name: ensure osdsctl exists + stat: + path: /opt/opensds-hotpot-linux-amd64/bin/osdsctl + ignore_errors: "true" + register: osdsctl_exists + +- name: run cinder-compatible-api, create opensds default profile + remote_user: root + shell: | + cd $HOME/gopath/src/github.com/os-stor4nfv/stor4nfv/ci/ansible; + export OPENSDS_ENDPOINT=http://{{ public_vip.ip }}:50040; + export CINDER_ENDPOINT=http://{{ internal_vip.ip }}:8776/v3; + chmod +x ../bin/cindercompatibleapi; + ( ( nohup ../bin/cindercompatibleapi > /var/log/cindercompatibleapi.log 2>&1 ) & ); + cp /opt/opensds-hotpot-linux-amd64/bin/osdsctl /usr/local/bin; + export OPENSDS_AUTH_STRATEGY=noauth; + osdsctl profile create '{"name": "default", "description": "default policy"}' + ignore_errors: "true" + when: + - osdsctl_exists.stat.exists -- cgit 1.2.3-korg