summaryrefslogtreecommitdiffstats
path: root/ci/nbp-ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ci/nbp-ansible')
-rw-r--r--ci/nbp-ansible/README.md10
-rw-r--r--ci/nbp-ansible/group_vars/common.yml18
-rw-r--r--ci/nbp-ansible/roles/cleaner/tasks/main.yml1
-rw-r--r--ci/nbp-ansible/roles/installer/scenarios/csi.yml0
-rw-r--r--ci/nbp-ansible/roles/installer/scenarios/flexvolume.yml (renamed from ci/nbp-ansible/roles/flexvolume/tasks/main.yml)0
-rw-r--r--ci/nbp-ansible/roles/installer/tasks/main.yml8
-rw-r--r--ci/nbp-ansible/site.yml2
7 files changed, 31 insertions, 8 deletions
diff --git a/ci/nbp-ansible/README.md b/ci/nbp-ansible/README.md
index 391bcc3..5a4c5ab 100644
--- a/ci/nbp-ansible/README.md
+++ b/ci/nbp-ansible/README.md
@@ -18,9 +18,6 @@ ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub <ip_address> # IP address of the target machine of the installation
```
-### Install docker
-If use a standalone cinder as backend, you also need to install docker to run cinder service. Please see the [docker installation document](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) for details.
-
### Install ansible tool
```bash
sudo add-apt-repository ppa:ansible/ansible # This step is needed to upgrade ansible to version 2.4.2 which is required for the ceph backend.
@@ -29,6 +26,13 @@ sudo apt-get install ansible
ansible --version # Ansible version 2.4.2 or higher is required for ceph; 2.0.0.2 or higher is needed for other backends.
```
+### Configure nbp plugin variable
+##### Common environment:
+Configure the ```nbp_plugin_type``` in `group_vars/common.yml` according to your environment:
+```yaml
+nbp_plugin_type: flexvolume # flexvolume is the default integration way, but you can change it from 'csi', 'flexvolume'
+```
+
### Check if the hosts can be reached
```bash
sudo ansible all -m ping -i nbp.hosts
diff --git a/ci/nbp-ansible/group_vars/common.yml b/ci/nbp-ansible/group_vars/common.yml
index 344cab7..3860660 100644
--- a/ci/nbp-ansible/group_vars/common.yml
+++ b/ci/nbp-ansible/group_vars/common.yml
@@ -15,9 +15,19 @@ dummy:
# GENERAL #
###########
-# These fields are not suggested to be modified
-nbp_download_url: https://github.com/opensds/nbp/releases/download/v0.1.0/opensds-k8s-linux-amd64.tar.gz
-nbp_tarball_url: /opt/opensds-k8s-linux-amd64.tar.gz
-nbp_dir: /opt/opensds-k8s-linux-amd64
+nbp_release: v0.1.0
+
+# These fields are not suggested to be modified
+nbp_download_url: https://github.com/opensds/nbp/releases/download/{{ nbp_release }}/opensds-k8s-{{ nbp_release }}-linux-amd64.tar.gz
+nbp_tarball_url: /opt/opensds-k8s-{{ nbp_release }}-linux-amd64.tar.gz
+nbp_dir: /opt/opensds-k8s-{{ nbp_release }}-linux-amd64
+
+
+###########
+# PLUGIN #
+###########
+
+nbp_plugin_type: flexvolume # flexvolume is the default integration way, but you can change it from 'csi', 'flexvolume'
flexvolume_plugin_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/opensds.io~opensds
+
diff --git a/ci/nbp-ansible/roles/cleaner/tasks/main.yml b/ci/nbp-ansible/roles/cleaner/tasks/main.yml
index 38678b0..9e81756 100644
--- a/ci/nbp-ansible/roles/cleaner/tasks/main.yml
+++ b/ci/nbp-ansible/roles/cleaner/tasks/main.yml
@@ -5,6 +5,7 @@
state: absent
force: yes
ignore_errors: yes
+ when: nbp_plugin_type == "flexvolume"
- name: clean nbp release files
file:
diff --git a/ci/nbp-ansible/roles/installer/scenarios/csi.yml b/ci/nbp-ansible/roles/installer/scenarios/csi.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ci/nbp-ansible/roles/installer/scenarios/csi.yml
diff --git a/ci/nbp-ansible/roles/flexvolume/tasks/main.yml b/ci/nbp-ansible/roles/installer/scenarios/flexvolume.yml
index 0bba93b..0bba93b 100644
--- a/ci/nbp-ansible/roles/flexvolume/tasks/main.yml
+++ b/ci/nbp-ansible/roles/installer/scenarios/flexvolume.yml
diff --git a/ci/nbp-ansible/roles/installer/tasks/main.yml b/ci/nbp-ansible/roles/installer/tasks/main.yml
new file mode 100644
index 0000000..58057f1
--- /dev/null
+++ b/ci/nbp-ansible/roles/installer/tasks/main.yml
@@ -0,0 +1,8 @@
+---
+- name: include scenarios/flexvolume.yml
+ include: scenarios/flexvolume.yml
+ when: nbp_plugin_type == "flexvolume"
+
+- name: include scenarios/csi.yml
+ include: scenarios/csi.yml
+ when: nbp_plugin_type == "csi"
diff --git a/ci/nbp-ansible/site.yml b/ci/nbp-ansible/site.yml
index 42c0790..7e22f83 100644
--- a/ci/nbp-ansible/site.yml
+++ b/ci/nbp-ansible/site.yml
@@ -10,4 +10,4 @@
become: True
roles:
- common
- - flexvolume
+ - installer