blob: 84515267ca99313a7dc6c4f8c0d80e715c4705fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
##############################################################################
# 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;
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;
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
|