aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramamani yeleswarapu <ramamani.yeleswarapu@intel.com>2018-03-26 14:23:49 -0700
committerJustin chi <chigang@huawei.com>2018-04-25 08:48:21 +0000
commitab73374e424a679cc42b9812e6bd39a49fcea07d (patch)
treeb6e3c22f2df57577f12324425668b42b01f61009
parent84036899c0ec4bde40c6b71e2c8d447bbdb79b0c (diff)
Stor4nfv: Install ansible version 2.4opnfv-6.0.0
Ansible 2.5 release is causing errors in the installation of ceph-ansible (for ceph-mon). This patch fixes the ansible version installed on kube_master to 2.4.3 to address the ceph errors. Also, adds these post-install tasks: - run 'modprobe rbd' - create opensds default profile - create csi pods. Change-Id: Iee8d27da68896009d2e27ce4a6c7f805524d086d Signed-off-by: Ramamani Yeleswarapu <ramamani.yeleswarapu@intel.com>
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh2
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/tasks/main.yml1
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml7
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml64
-rw-r--r--plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j220
5 files changed, 86 insertions, 8 deletions
diff --git a/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh b/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh
index b4a3a30a..d921d4e2 100644
--- a/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh
+++ b/plugins/stor4nfv/roles/stor4nfv/files/install_ansible.sh
@@ -8,7 +8,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
# #############################################################################
-add-apt-repository ppa:ansible/ansible
+add-apt-repository ppa:ansible/ansible-2.4
apt-get update
apt-get install -y ansible
diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/main.yml
index 353282f9..060c9cf1 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: post-install.yml
when:
- ansible_distribution == 'Ubuntu'
- stor4nfv is defined and stor4nfv == "Enable"
diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml
index 7866e808..a095ceb0 100644
--- a/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml
+++ b/plugins/stor4nfv/roles/stor4nfv/tasks/opensds.yml
@@ -75,10 +75,3 @@
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
diff --git a/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml
new file mode 100644
index 00000000..55d26d69
--- /dev/null
+++ b/plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml
@@ -0,0 +1,64 @@
+# #############################################################################
+# 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: ensure ceph-ansible dir exists
+ stat:
+ path: /opt/ceph-ansible
+ ignore_errors: "true"
+ register: ceph_ansible_exists
+
+- name: copy post-install.yml to /opt/ceph-ansible
+ remote_user: root
+ template:
+ src: post-install.yml.j2
+ dest: /opt/ceph-ansible/post-install.yml
+ when:
+ - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists
+
+- name: run post-install playbook
+ shell: ansible-playbook post-install.yml -i ceph.hosts
+ become: true
+ args:
+ chdir: /opt/ceph-ansible
+ when:
+ - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists
+
+- name: remove post-install.yml
+ file:
+ path: /opt/ceph-ansible/post-install.yml
+ state: absent
+ when:
+ - ceph_ansible_exists.stat.exists is defined and ceph_ansible_exists.stat.exists
+
+- name: ensure osdsctl exists
+ stat:
+ path: /opt/opensds-v0.1.5-linux-amd64/bin/osdsctl
+ ignore_errors: "true"
+ register: osdsctl_exists
+
+- name: ensure opensds csi directory exists
+ stat:
+ path: /opt/opensds-k8s-v0.1.0-linux-amd64
+ ignore_errors: "true"
+ register: csi_dir_exists
+
+- name: create opensds default profile, csi pods
+ remote_user: root
+ shell: |
+ cp /opt/opensds-v0.1.5-linux-amd64/bin/osdsctl /usr/local/bin;
+ export OPENSDS_ENDPOINT=http://{{ public_vip.ip }}:50040;
+ export OPENSDS_AUTH_STRATEGY=noauth;
+ osdsctl profile create '{"name": "default", "description": "default policy"}'
+ cd /opt/opensds-k8s-v0.1.0-linux-amd64;
+ kubectl create -f csi/deploy/kubernetes;
+ ignore_errors: "true"
+ when:
+ - osdsctl_exists.stat.exists is defined and osdsctl_exists.stat.exists
+ - csi_dir_exists.stat.exists is defined and csi_dir_exists.stat.exists
diff --git a/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2 b/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2
new file mode 100644
index 00000000..662abc34
--- /dev/null
+++ b/plugins/stor4nfv/roles/stor4nfv/templates/post-install.yml.j2
@@ -0,0 +1,20 @@
+# #############################################################################
+# 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
+# #############################################################################
+---
+
+- hosts:
+ - mons
+ - osds
+ - mgrs
+
+ tasks:
+ - name: run modprobe rbd
+ remote_user: root
+ command: modprobe rbd
+ ignore_errors: "true"