diff options
author | 2016-12-27 17:44:34 +0800 | |
---|---|---|
committer | 2017-01-05 09:42:35 +0800 | |
commit | 92f6ca7bb6d7b2f295406aab34094b1dba76ff94 (patch) | |
tree | c4e62927a3bf9862f7ba9ce286cbece2c4335ef4 /deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml | |
parent | 6072a49adb33f2bce3f48b9c7b8be7d96cf8501c (diff) |
Yamllint test
JIRA: COMPASS-516
Change-Id: I482ce9bc86f4f963258c5b8823e0b00e83556eef
Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml')
-rwxr-xr-x | deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml | 98 |
1 files changed, 91 insertions, 7 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 index 0496ba97..84515267 100755 --- a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml +++ b/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_conf.yml @@ -12,29 +12,113 @@ when: inventory_hostname in groups['controller'] tags: - ceph_conf_glance - ignore_errors: True + 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\nrbd_store_user = glance\nrbd_store_ceph_conf = /etc/ceph/ceph.conf\nrbd_store_chunk_size = 8\nshow_image_direct_url=True' /etc/glance/glance-api.conf + 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: restart glance - shell: rm -f /var/log/glance/api.log && chown -R glance:glance /var/log/glance && service {{ glance_service }} restart +- 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 - ignore_errors: True - 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 && sed -i '/^\[DEFAULT/a rbd_pool = volumes\nrbd_ceph_conf = /etc/ceph/ceph.conf\nrbd_flatten_volume_from_snapshot = false\nrbd_max_clone_depth = 5\nrbd_store_chunk_size = 4\nrados_connect_timeout = -1\nglance_api_version = 2\nrbd_user = cinder\nrbd_secret_uuid = {{ ceph_uuid }}' /etc/cinder/cinder.conf && service {{ cinder_service }} restart + 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; + sed -i '/^\[DEFAULT/a rbd_pool = volumes' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rbd_ceph_conf = /etc/ceph/ceph.conf' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rbd_flatten_volume_from_snapshot = false' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rbd_max_clone_depth = 5' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rbd_store_chunk_size = 4' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rados_connect_timeout = -1' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a glance_api_version = 2' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rbd_user = cinder' \ + /etc/cinder/cinder.conf; + sed -i '/^\[DEFAULT/a rbd_secret_uuid = {{ ceph_uuid }}' \ + /etc/cinder/cinder.conf; + 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 && sed -i '/^\[libvirt/a images_rbd_pool = vms\nimages_rbd_ceph_conf = /etc/ceph/ceph.conf\nrbd_user = cinder\nrbd_secret_uuid = {{ ceph_uuid }}\ndisk_cachemodes=\"network=writeback\"\nlive_migration_flag=\"VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED\"' /etc/nova/nova-compute.conf && service {{ nova_service }} restart + 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 |