From 4bc89660111fbd2fe8a7edc1cbc053b2e297ec56 Mon Sep 17 00:00:00 2001 From: ramamani yeleswarapu Date: Wed, 7 Feb 2018 21:33:40 -0800 Subject: Add plugin for Stor4nfv for k8s deploy - Adds 'stor4nfv' plugin which installs OpenSDS using stor4nfv. - Adds k8s-nosdn-stor4nfv-ha scenario file. - Adds k8s-nosdn-stor4nfv-noha scenario file. Change-Id: Iee718a48994ad4e55f4b7a01933bd4e7773ac67f Signed-off-by: ramamani yeleswarapu --- plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml | 84 +++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml (limited to 'plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml') diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml new file mode 100644 index 00000000..afd65bc7 --- /dev/null +++ b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml @@ -0,0 +1,84 @@ +# ############################################################################# +# 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: + - make + - gcc + +- 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" + +- name: install ceph-ansible code + remote_user: root + shell: | + cd /opt; + git clone https://github.com/ceph/ceph-ansible.git + +- name: fetch stor4nfv source code + remote_user: root + shell: | + mkdir -p $HOME/gopath/src/github.com/stor4nfv && cd $HOME/gopath/src/github.com/stor4nfv; + git clone https://gerrit.opnfv.org/gerrit/stor4nfv.git + +- name: copy configure_vars script + remote_user: root + copy: + src: configure_vars.sh + dest: /opt/configure_vars.sh + mode: 0777 + +- name: configure variables for ceph, opensds + remote_user: root + shell: | + cd /opt; + ./configure_vars.sh {{ mgmt_cidr }} {{ external_cidr }} + +- name: render ceph inventory + remote_user: root + template: + src: ceph.hosts.j2 + dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/group_vars/ceph/ceph.hosts + +- name: render opensds inventory + remote_user: root + template: + src: opensds.hosts.j2 + dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/local.hosts + +- name: force to run the second etcd cluster + remote_user: root + lineinfile: + dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/roles/osdsdb/scenarios/etcd.yml + state: absent + regexp: 'when: service_etcd_status.rc != 0' + +- name: run playbook + remote_user: root + shell: | + cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible; + ansible-playbook site.yml -i local.hosts | tee /var/log/stor4nfv.log + register: stor4nfv_result + +- name: export opensds endpoint + remote_user: root + shell: | + export OPENSDS_ENDPOINT=http://127.0.0.1:50040 + when: stor4nfv_result|succeeded -- cgit 1.2.3-korg