X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fansible%2Froles%2Fosdsdock%2Fscenarios%2Fceph.yml;h=16aca67c0c1a4d28fa5d961740d88cf21da8e7af;hb=4ced57eae63a52ea517d4087662726d942da8441;hp=2b6196ce4ffd5baab4fa6f8c858cd0f61f63f97d;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/ci/ansible/roles/osdsdock/scenarios/ceph.yml b/ci/ansible/roles/osdsdock/scenarios/ceph.yml old mode 100755 new mode 100644 index 2b6196c..16aca67 --- a/ci/ansible/roles/osdsdock/scenarios/ceph.yml +++ b/ci/ansible/roles/osdsdock/scenarios/ceph.yml @@ -1,74 +1,111 @@ ---- -- name: install ceph-common external package when ceph backend enabled - apt: - name: ceph-common - when: enabled_backend == "ceph" - -- name: copy opensds ceph backend file if specify ceph backend - copy: - src: ../../../group_vars/ceph/ceph.yaml - dest: "{{ ceph_config_path }}" - -- name: check for ceph-ansible source code existed - stat: - path: /opt/ceph-ansible - ignore_errors: yes - register: cephansibleexisted - -- name: download ceph-ansible source code - git: - repo: https://github.com/ceph/ceph-ansible.git - dest: /opt/ceph-ansible - when: - - cephansibleexisted.stat.exists is undefined or cephansibleexisted.stat.exists == false - -- name: copy ceph inventory host into ceph-ansible directory - copy: - src: ../../../group_vars/ceph/ceph.hosts - dest: /opt/ceph-ansible/ceph.hosts - -- name: copy ceph all.yml file into ceph-ansible group_vars directory - copy: - src: ../../../group_vars/ceph/all.yml - dest: /opt/ceph-ansible/group_vars/all.yml - -- name: copy ceph osds.yml file into ceph-ansible group_vars directory - copy: - src: ../../../group_vars/ceph/osds.yml - dest: /opt/ceph-ansible/group_vars/osds.yml - -- name: copy site.yml.sample to site.yml in ceph-ansible - copy: - src: /opt/ceph-ansible/site.yml.sample - dest: /opt/ceph-ansible/site.yml - -- name: ping all hosts - shell: ansible all -m ping -i ceph.hosts - become: true - args: - chdir: /opt/ceph-ansible - -- name: run ceph-ansible playbook - shell: ansible-playbook site.yml -i ceph.hosts | tee /var/log/ceph_ansible.log - become: true - args: - chdir: /opt/ceph-ansible - -#- name: Check if ceph osd is running -# shell: ps aux | grep ceph-osd | grep -v grep -# ignore_errors: false -# changed_when: false -# register: service_ceph_osd_status - -- name: Check if ceph mon is running - shell: ps aux | grep ceph-mon | grep -v grep - ignore_errors: false - changed_when: false - register: service_ceph_mon_status - -- name: Create a pool and initialize it. - shell: ceph osd pool create {{ ceph_pool_name }} 100 && ceph osd pool set {{ ceph_pool_name }} size 1 - ignore_errors: yes - changed_when: false - register: ceph_init_pool - when: service_ceph_mon_status.rc == 0 # and service_ceph_osd_status.rc == 0 +# Copyright (c) 2018 Huawei Technologies Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +- name: install ceph-common external package when ceph backend enabled + apt: + name: "{{ item }}" + state: present + with_items: + - ceph-common + +- name: install notario package with pip when ceph backend enabled + pip: + name: "{{ item }}" + with_items: + - notario + +- name: configure ceph section in opensds global info if specify ceph backend + shell: | + cat >> opensds.conf <