|
101 | 101 | - "{{ osd_hosts }}"
|
102 | 102 | when: hostvars[item.0]['ansible_facts']['hostname'] == item.1
|
103 | 103 |
|
| 104 | + - name: set_fact host_list |
| 105 | + set_fact: |
| 106 | + host_list: "{{ host_list | default([]) | union([item.0]) }}" |
| 107 | + loop: "{{ _osd_hosts }}" |
| 108 | + |
104 | 109 | - name: get ceph-volume lvm list data
|
105 | 110 | ceph_volume:
|
106 | 111 | cluster: "{{ cluster }}"
|
|
109 | 114 | CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
110 | 115 | CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
111 | 116 | register: _lvm_list_data
|
112 |
| - delegate_to: "{{ item.0 }}" |
113 |
| - loop: "{{ _osd_hosts }}" |
| 117 | + delegate_to: "{{ item }}" |
| 118 | + loop: "{{ host_list }}" |
114 | 119 |
|
115 | 120 | - name: set_fact _lvm_list
|
116 | 121 | set_fact:
|
117 | 122 | _lvm_list: "{{ _lvm_list | default({}) | combine(item.stdout | from_json) }}"
|
118 | 123 | with_items: "{{ _lvm_list_data.results }}"
|
119 | 124 |
|
| 125 | + - name: refresh /etc/ceph/osd files non containerized_deployment |
| 126 | + ceph_volume_simple_scan: |
| 127 | + cluster: "{{ cluster }}" |
| 128 | + force: true |
| 129 | + delegate_to: "{{ item }}" |
| 130 | + loop: "{{ host_list }}" |
| 131 | + when: not containerized_deployment | bool |
| 132 | + |
| 133 | + - name: refresh /etc/ceph/osd files containerized_deployment |
| 134 | + command: "{{ container_binary }} exec ceph-osd-{{ item.2 }} ceph-volume simple scan --force /var/lib/ceph/osd/{{ cluster }}-{{ item.2 }}" |
| 135 | + changed_when: false |
| 136 | + delegate_to: "{{ item.0 }}" |
| 137 | + loop: "{{ _osd_hosts }}" |
| 138 | + when: containerized_deployment | bool |
| 139 | + |
120 | 140 | - name: find /etc/ceph/osd files
|
121 | 141 | find:
|
122 | 142 | paths: /etc/ceph/osd
|
|
0 commit comments