Update Stor4nfv plugin with nbp csi install 01/52701/2
authorramamani yeleswarapu <ramamani.yeleswarapu@intel.com>
Tue, 27 Feb 2018 04:30:44 +0000 (20:30 -0800)
committerramamani yeleswarapu <ramamani.yeleswarapu@intel.com>
Tue, 27 Feb 2018 22:33:55 +0000 (14:33 -0800)
Change-Id: Ia32ea3c29b78f18aae258fa89b017e894b09301f
Signed-off-by: ramamani yeleswarapu <ramamani.yeleswarapu@intel.com>
plugins/stor4nfv/roles/stor4nfv/tasks/main.yml
plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml [new file with mode: 0644]
plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2 [new file with mode: 0644]

index 353282f..89d13f4 100644 (file)
@@ -8,6 +8,7 @@
 # #############################################################################
 ---
 - include: opensds.yml
+- include: nbp.yml
   when:
     - ansible_distribution == 'Ubuntu'
     - stor4nfv is defined and stor4nfv == "Enable"
diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml
new file mode 100644 (file)
index 0000000..5361f5c
--- /dev/null
@@ -0,0 +1,27 @@
+# #############################################################################
+# 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: render nbp inventory
+  remote_user: root
+  template:
+    src: nbp.hosts.j2
+    dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/nbp-ansible/nbp.hosts
+
+- name: set nbp to csi
+  remote_user: root
+  shell: |
+    cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/nbp-ansible;
+    sed -i 's/^nbp_plugin_type.*/nbp_plugin_type: csi/g' group_vars/common.yml
+
+- name: run playbook
+  remote_user: root
+  shell: |
+    cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/nbp-ansible;
+    ansible-playbook site.yml -i nbp.hosts | tee /var/log/stor4nfv-nbp.log
diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2
new file mode 100644 (file)
index 0000000..0e8fa4c
--- /dev/null
@@ -0,0 +1,4 @@
+[worker-nodes]
+{% for worker in hostvars[inventory_hostname]['groups']['storage_master'] %}
+{{ worker }} ansible_ssh_host={{ hostvars[worker]['ansible_ssh_host'] }}
+{% endfor %}