summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorYifei Xue <xueyifei@huawei.com>2018-03-01 01:07:01 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-01 01:07:01 +0000
commitd9c78464420c0e40beeca60e982d6f86f96509af (patch)
tree3d497ea1f198e88f9ccf71ad044c63db4f6fb5c1 /plugins
parent047bd241fe9ac576ca967593022f1195e38a8041 (diff)
parent0d7ba90b8e90b948842ae7a41d14a6af7fad9e8a (diff)
Merge "Update Stor4nfv plugin with nbp csi install"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/tasks/main.yml1
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml27
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j24
3 files changed, 32 insertions, 0 deletions
diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml
index 353282f9..89d13f41 100644
--- a/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml
+++ b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml
@@ -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
index 00000000..5361f5cd
--- /dev/null
+++ b/plugins/stor4nfv/roles/stor4nfv/tasks/nbp.yml
@@ -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
index 00000000..0e8fa4c9
--- /dev/null
+++ b/plugins/stor4nfv/roles/stor4nfv/templates/nbp.hosts.j2
@@ -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 %}