summaryrefslogtreecommitdiffstats
path: root/ci/ansible/roles/common/tasks
diff options
context:
space:
mode:
authorleonwang <wanghui71@huawei.com>2018-03-15 08:25:05 +0000
committerleonwang <wanghui71@huawei.com>2018-03-15 08:39:22 +0000
commit6bc7e08cc5d80941c80e8d36d3a2b1373f147a05 (patch)
tree3e236cfc1f4ce35ad8ab09843010d16010da4054 /ci/ansible/roles/common/tasks
parent6018fcdd41c2074b2c94d8033f1434be028b054b (diff)
Merge nbp installation into opensds ansible script
In this update, the nbp-ansible is removed from stor4nfv repo and all code has been merged into ansible repo. Besides, the latest update reduce a lot of work to download and build opensds source code. And some installation docs are also updated. Remove license statement for the moment. Change-Id: Ib8504d96e2d41e1c3ab7e0c94689111679d56abd Signed-off-by: leonwang <wanghui71@huawei.com>
Diffstat (limited to 'ci/ansible/roles/common/tasks')
-rw-r--r--[-rwxr-xr-x]ci/ansible/roles/common/tasks/main.yml242
1 files changed, 121 insertions, 121 deletions
diff --git a/ci/ansible/roles/common/tasks/main.yml b/ci/ansible/roles/common/tasks/main.yml
index d6bef82..7ae2234 100755..100644
--- a/ci/ansible/roles/common/tasks/main.yml
+++ b/ci/ansible/roles/common/tasks/main.yml
@@ -1,121 +1,121 @@
----
-# If we can't get golang installed before any module is used we will fail
-# so just try what we can to get it installed
-- name: check for golang
- stat:
- path: /usr/local/go
- ignore_errors: yes
- register: systemgolang
-
-- name: install golang for debian based systems
- shell:
- cmd: |
- set -e
- set -x
-
- wget {{ golang_download_url }} -P /opt/
- tar xvf /opt/{{ golang_tarball }} -C /usr/local/
- cat >> /etc/profile <<GOLANG__CONFIG_DOC
- export GOROOT=/usr/local/go
- export GOPATH=\$HOME/gopath
- export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin
- GOLANG__CONFIG_DOC
-
- executable: /bin/bash
- ignore_errors: yes
- when:
- - systemgolang.stat.exists is undefined or systemgolang.stat.exists == false
-
-- name: Run the equivalent of "apt-get update" as a separate step
- apt:
- update_cache: yes
-
-- name: install librados-dev external package
- apt:
- name: librados-dev
-
-- name: install librbd-dev external package
- apt:
- name: librbd-dev
-
-- pip:
- name: docker-py
- when: container_enabled == true
-
-- name: check for opensds source code existed
- stat:
- path: "{{ opensds_root_dir }}"
- ignore_errors: yes
- register: opensdsexisted
-
-- name: download opensds source code
- git:
- repo: "{{ remote_url }}"
- dest: "{{ opensds_root_dir }}"
- when:
- - opensdsexisted.stat.exists is undefined or opensdsexisted.stat.exists == false
-
-- name: check for opensds binary file existed
- stat:
- path: "{{ opensds_build_dir }}"
- ignore_errors: yes
- register: opensdsbuilt
-
-- name: build opensds binary file
- shell: . /etc/profile; make
- args:
- chdir: "{{ opensds_root_dir }}"
- when:
- - opensdsbuilt.stat.exists is undefined or opensdsbuilt.stat.exists == false
-
-- name: create opensds global config directory if it doesn't exist
- file:
- path: "{{ opensds_config_dir }}/driver"
- state: directory
- mode: 0755
-
-- name: create opensds log directory if it doesn't exist
- file:
- path: "{{ opensds_log_dir }}"
- state: directory
- mode: 0755
-
-- name: configure opensds global info
- shell: |
- cat > opensds.conf <<OPENSDS_GLOABL_CONFIG_DOC
- [osdslet]
- api_endpoint = {{ controller_endpoint }}
- graceful = True
- log_file = {{ controller_log_file }}
- socket_order = inc
-
- [osdsdock]
- api_endpoint = {{ dock_endpoint }}
- log_file = {{ dock_log_file }}
- # Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
- enabled_backends = {{ enabled_backend }}
-
- [lvm]
- name = {{ lvm_name }}
- description = {{ lvm_description }}
- driver_name = {{ lvm_driver_name }}
- config_path = {{ lvm_config_path }}
-
- [ceph]
- name = {{ ceph_name }}
- description = {{ ceph_description }}
- driver_name = {{ ceph_driver_name }}
- config_path = {{ ceph_config_path }}
-
- [cinder]
- name = {{ cinder_name }}
- description = {{ cinder_description }}
- driver_name = {{ cinder_driver_name }}
- config_path = {{ cinder_config_path }}
-
- [database]
- endpoint = {{ db_endpoint }}
- driver = {{ db_driver }}
- args:
- chdir: "{{ opensds_config_dir }}"
- ignore_errors: yes
+---
+- name: run the equivalent of "apt-get update" as a separate step
+ apt:
+ update_cache: yes
+
+- name: install librados-dev and librbd-dev external packages
+ apt:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - librados-dev
+ - librbd-dev
+
+- name: install docker-py package with pip when enabling containerized deployment
+ pip:
+ name: docker-py
+ when: container_enabled == true
+
+- name: check for opensds release files existed
+ stat:
+ path: "{{ opensds_dir }}"
+ ignore_errors: yes
+ register: opensdsreleasesexisted
+
+- name: download opensds release files
+ get_url:
+ url={{ opensds_download_url }}
+ dest={{ opensds_tarball_url }}
+ when:
+ - opensdsreleasesexisted.stat.exists is undefined or opensdsreleasesexisted.stat.exists == false
+
+- name: extract the opensds release tarball
+ unarchive:
+ src={{ opensds_tarball_url }}
+ dest=/opt/
+ when:
+ - opensdsreleasesexisted.stat.exists is undefined or opensdsreleasesexisted.stat.exists == false
+
+- name: check for nbp release files existed
+ stat:
+ path: "{{ nbp_dir }}"
+ ignore_errors: yes
+ register: nbpreleasesexisted
+
+- name: download nbp release files
+ get_url:
+ url={{ nbp_download_url }}
+ dest={{ nbp_tarball_url }}
+ when:
+ - nbpreleasesexisted.stat.exists is undefined or nbpreleasesexisted.stat.exists == false
+
+- name: extract the nbp release tarball
+ unarchive:
+ src={{ nbp_tarball_url }}
+ dest=/opt/
+ when:
+ - nbpreleasesexisted.stat.exists is undefined or nbpreleasesexisted.stat.exists == false
+
+- name: change the mode of all binary files in opensds release
+ file:
+ path: "{{ opensds_dir }}/bin"
+ mode: 0755
+ recurse: yes
+
+- name: change the mode of all binary files in nbp release
+ file:
+ path: "{{ nbp_dir }}/flexvolume"
+ mode: 0755
+ recurse: yes
+
+- name: create opensds global config directory if it doesn't exist
+ file:
+ path: "{{ opensds_config_dir }}/driver"
+ state: directory
+ mode: 0755
+
+- name: create opensds log directory if it doesn't exist
+ file:
+ path: "{{ opensds_log_dir }}"
+ state: directory
+ mode: 0755
+
+- name: configure opensds global info
+ shell: |
+ cat > opensds.conf <<OPENSDS_GLOABL_CONFIG_DOC
+ [osdslet]
+ api_endpoint = {{ controller_endpoint }}
+ graceful = True
+ log_file = {{ controller_log_file }}
+ socket_order = inc
+
+ [osdsdock]
+ api_endpoint = {{ dock_endpoint }}
+ log_file = {{ dock_log_file }}
+ # Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
+ enabled_backends = {{ enabled_backend }}
+
+ [lvm]
+ name = {{ lvm_name }}
+ description = {{ lvm_description }}
+ driver_name = {{ lvm_driver_name }}
+ config_path = {{ lvm_config_path }}
+
+ [ceph]
+ name = {{ ceph_name }}
+ description = {{ ceph_description }}
+ driver_name = {{ ceph_driver_name }}
+ config_path = {{ ceph_config_path }}
+
+ [cinder]
+ name = {{ cinder_name }}
+ description = {{ cinder_description }}
+ driver_name = {{ cinder_driver_name }}
+ config_path = {{ cinder_config_path }}
+
+ [database]
+ endpoint = {{ db_endpoint }}
+ driver = {{ db_driver }}
+ args:
+ chdir: "{{ opensds_config_dir }}"
+ ignore_errors: yes