diff options
author | 2016-11-30 11:33:04 +0800 | |
---|---|---|
committer | 2016-12-10 13:21:03 +0000 | |
commit | 9fa28e023cb149256702e86628da72ea3372c250 (patch) | |
tree | a0ebced3b8c8da6073bc070903becc82ff7d2788 /deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml | |
parent | 8563de45cd6dce04affcd9a52dacd76dad27ecae (diff) |
Support compute node expansion with ceph-osd
JIRA: COMPASS-481
- Use public_vip to fetch ceph related conf from controller nodes.
- Add ceph-uuid for libvirt store and fetch for expansion.
Change-Id: I9e93183ac108bd959a1226546fbb89706e3004c9
Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml')
-rwxr-xr-x | deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml | 32 |
1 files changed, 30 insertions, 2 deletions
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 index 78b71ec0..ece4154f 100755 --- a/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml +++ b/deploy/adapters/ansible/roles/ceph-openstack/tasks/ceph_openstack_pre.yml @@ -9,11 +9,39 @@ --- - name: gen ceph uuid shell: uuidgen - register: ceph_uuid + 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" @@ -68,7 +96,7 @@ - name: create key for libvirt on compute nodes - shell: "virsh secret-define --file ~/secret.xml && virsh secret-set-value --secret {{ ceph_uuid.stdout_lines[0] }} --base64 $(cat client.cinder.key)" + 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 |