diff options
author | 2017-06-30 20:24:25 +0800 | |
---|---|---|
committer | 2017-07-03 21:19:28 +0800 | |
commit | 95ecdb773c9fa90f9e4f1f792f5cc5dc8328fd6a (patch) | |
tree | 1b012703eb52f78fe35119a4f9eba98b221f69d9 /deploy/adapters/ansible/roles/ceph-openstack/tasks | |
parent | d529e77a45c77c10ac6970ca9e733e92e89d138f (diff) |
Remove obsoleted code
JIRA:-
use OpenStack-ansible deploy openstack, so remove obsoleted code.
Some of the enhanced features will be added in later versions
Change-Id: Ie92b92b5de234a7d7d03b578b0bc15fd0218b3b3
Signed-off-by: chigang <chigang@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ceph-openstack/tasks')
4 files changed, 0 insertions, 302 deletions
diff --git a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml b/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml deleted file mode 100755 index 5d9138bb..00000000 --- a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml +++ /dev/null @@ -1,130 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# 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: chown of glance/api.log - shell: chown -R glance:glance /var/log/glance - when: inventory_hostname in groups['controller'] - tags: - - ceph_conf_glance - ignore_errors: "True" - -- name: modify glance-api.conf for ceph - shell: | - sed -i 's/^\(default_store\).*/\1 = rbd/g' /etc/glance/glance-api.conf; - sed -i '/^\[glance_store/a rbd_store_pool = images' \ - /etc/glance/glance-api.conf; - sed -i '/^\[glance_store/a rbd_store_user = glance' \ - /etc/glance/glance-api.conf; - sed -i '/^\[glance_store/a rbd_store_ceph_conf = /etc/ceph/ceph.conf' \ - /etc/glance/glance-api.conf; - sed -i '/^\[glance_store/a rbd_store_chunk_size = 8' \ - /etc/glance/glance-api.conf; - sed -i '/^\[glance_store/a show_image_direct_url=True' \ - /etc/glance/glance-api.conf; - when: inventory_hostname in groups['controller'] - tags: - - ceph_conf_glance - -- name: remove glance-api log - shell: | - rm -f /var/log/glance/api.log; - chown -R glance:glance /var/log/glance; - when: inventory_hostname in groups['controller'] - tags: - - ceph_conf_glance - ignore_errors: "True" - -- name: restart glance service - shell: service {{ glance_service }} restart - register: result - until: result.rc == 0 - retries: 10 - delay: 3 - when: inventory_hostname in groups['controller'] - tags: - - ceph_conf_glance - -- name: modify cinder.conf for ceph - shell: | - sed -i 's/^\(volume_driver\).*/\1 = cinder.volume.drivers.rbd.RBDDriver/g' \ - /etc/cinder/cinder.conf; - sed -i 's/^\(rbd_secret_uuid\).*/\1 = {{ ceph_uuid }}/g' \ - /etc/cinder/cinder.conf; - crudini --set /etc/cinder/cinder.conf DEFAULT enabled_backends \ - ceph; - crudini --del /etc/cinder/cinder.conf lvm - crudini --set /etc/cinder/cinder.conf ceph volume_driver \ - cinder.volume.drivers.rbd.RBDDriver; - crudini --set /etc/cinder/cinder.conf ceph volume_backend_name \ - ceph; - crudini --set /etc/cinder/cinder.conf ceph rbd_pool volumes; - crudini --set /etc/cinder/cinder.conf ceph rbd_ceph_conf \ - /etc/ceph/ceph.conf; - crudini --set /etc/cinder/cinder.conf ceph rbd_flatten_volume_from_snapshot \ - false; - crudini --set /etc/cinder/cinder.conf ceph rbd_max_clone_depth \ - 5; - crudini --set /etc/cinder/cinder.conf ceph rbd_store_chunk_size \ - 4; - crudini --set /etc/cinder/cinder.conf ceph rados_connect_timeout \ - -1; - crudini --set /etc/cinder/cinder.conf ceph glance_api_version \ - 2; - crudini --set /etc/cinder/cinder.conf ceph rbd_user \ - cinder; - crudini --set /etc/cinder/cinder.conf ceph rbd_secret_uuid \ - {{ ceph_uuid }}; - when: inventory_hostname in groups['compute'] - tags: - - ceph_conf_cinder - -- name: restart cinder service - shell: service {{ cinder_service }} restart - register: result - until: result.rc == 0 - retries: 10 - delay: 3 - when: inventory_hostname in groups['compute'] - tags: - - ceph_conf_cinder - -- name: modify nova.conf for ceph - shell: | - sed -i 's/^\(images_type\).*/\1 = rbd/g' \ - /etc/nova/nova-compute.conf; - sed -i 's/^\(rbd_secret_uuid\).*/\1 = {{ ceph_uuid }}/g' \ - /etc/nova/nova-compute.conf; - when: inventory_hostname in groups['compute'] - tags: - - ceph_conf_nova - -- name: modify nova.conf libvirt for ceph - blockinfile: - dest: /etc/nova/nova-compute.conf - insertafter: "libvirt" - block: | - images_rbd_pool = vms - images_rbd_ceph_conf = /etc/ceph/ceph.conf - rbd_user = cinder - rbd_secret_uuid = {{ ceph_uuid }} - disk_cachemodes = "network=writeback" - live_migration_flag = "{{ live_migration_flag | join(',') }}" - when: inventory_hostname in groups['compute'] - tags: - - ceph_conf_nova - -- name: restart nova service - shell: service {{ nova_service }} restart - register: result - until: result.rc == 0 - retries: 10 - delay: 3 - when: inventory_hostname in groups['compute'] - tags: - - ceph_conf_nova diff --git a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_post.yml b/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_post.yml deleted file mode 100644 index b7ec4a23..00000000 --- a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_post.yml +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################## -## Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -## -## 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: get mount info - command: mount - register: mount_info - -- name: try unmount image nfs directory - shell: | - umount /var/lib/glance/images - sed -i '/\/var\/lib\/glance\/images/d' /etc/fstab - when: mount_info.stdout.find('images') != -1 diff --git a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml b/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml deleted file mode 100755 index a9eb81af..00000000 --- a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml +++ /dev/null @@ -1,120 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# 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: gen ceph uuid - shell: uuidgen - register: ceph_uuid_out - run_once: true - tags: - - ceph_copy_secret - -- name: set ceph uuid var - set_fact: - ceph_uuid: "{{ ceph_uuid_out.stdout_lines[0] }}" - when: not compute_expansion - tags: - - ceph_copy_secret - -- name: save ceph uuid for expansion - copy: content="{{ ceph_uuid }}" dest=/etc/ceph/ceph.uuid.libvirt - when: not compute_expansion and inventory_hostname in groups['controller'] - tags: - - ceph_copy_secret - -- name: fetch ceph uuid from controller node for expansion - shell: cat /etc/ceph/ceph.uuid.libvirt - register: ceph_uuid_out - delegate_to: "{{ public_vip.ip }}" - when: compute_expansion and inventory_hostname in groups['compute'] - tags: - - ceph_copy_secret - -- name: set ceph uuid var for expansion - set_fact: - ceph_uuid: "{{ ceph_uuid_out.stdout_lines[0] }}" - when: compute_expansion and inventory_hostname in groups['compute'] - tags: - - ceph_copy_secret - -- name: gen template secret.xml - local_action: - module: "template" - src: "secret.j2" - dest: "/tmp/secret.xml" - mode: "0777" - when: inventory_hostname in groups['ceph_adm'] - tags: - - ceph_copy_secret - -- name: create pool - shell: ceph osd pool create {{ item }} 50 - with_items: - - volumes - - images - - backups - - vms - when: inventory_hostname in groups['ceph_adm'] - -# yamllint disable rule:line-length -- name: create ceph users for openstack - shell: | - ceph auth get-or-create client.cinder mon 'allow r' osd \ - 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'; - ceph auth get-or-create client.glance mon 'allow r' osd \ - 'allow class-read object_prefix rbd_children, allow rwx pool=images'; - when: inventory_hostname in groups['ceph_adm'] -# yamllint enable rule:line-length - -- name: send glance key to controller nodes - shell: | - ceph auth get-or-create client.glance | \ - tee /etc/ceph/ceph.client.glance.keyring; - chown glance:glance /etc/ceph/ceph.client.glance.keyring; - when: inventory_hostname in groups['controller'] - -- name: send cinder key to compute nodes - shell: | - ceph auth get-or-create client.cinder | \ - tee /etc/ceph/ceph.client.cinder.keyring; - chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring; - when: inventory_hostname in groups['compute'] - tags: - - ceph_send_key - -- name: copy cinder key to compute node - shell: ceph auth get-key client.cinder | tee client.cinder.key - when: inventory_hostname in groups['compute'] - tags: - - ceph_copy_secret - -- name: copy secret.xml to compute nodes - copy: src="/tmp/secret.xml" dest="~/secret.xml" - when: inventory_hostname in groups['compute'] - tags: - - ceph_copy_secret - -- name: undefine libvirt secret in case of repeatedly execute ceph_deploy - shell: | - virsh secret-list | awk '$1 ~ /[0-9]+/ {print $1}' | \ - xargs virsh secret-undefine - when: inventory_hostname in groups['compute'] - tags: - - ceph_copy_secret - ignore_errors: "True" - - -- name: create key for libvirt on compute nodes - shell: | - virsh secret-define --file ~/secret.xml; - virsh secret-set-value --secret {{ ceph_uuid }} \ - --base64 $(cat client.cinder.key); - when: inventory_hostname in groups['compute'] - tags: - - ceph_copy_secret - ignore_errors: "True" diff --git a/deploy/adapters/ansible/roles/ceph-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/ceph-openstack/tasks/main.yml deleted file mode 100644 index c34d1376..00000000 --- a/deploy/adapters/ansible/roles/ceph-openstack/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# 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 -############################################################################## -- include_vars: "{{ ansible_os_family }}.yml" - tags: - - ceph_deploy - - ceph_openstack_pre - - ceph_openstack_conf - - ceph_openstack_post - - ceph_openstack - -- include: ceph_openstack_pre.yml - tags: - - ceph_deploy - - ceph_openstack_pre - - ceph_openstack - -- include: ceph_openstack_conf.yml - tags: - - ceph_deploy - - ceph_openstack_conf - - ceph_openstack - -- include: ceph_openstack_post.yml - tags: - - ceph_deploy - - ceph_openstack_post - - ceph_openstack |