aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml')
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml84
1 files changed, 84 insertions, 0 deletions
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