Use only short names in Ceph MON config
This commit is contained in:
parent
52862f9daf
commit
c71415317a
|
@ -33,14 +33,14 @@
|
||||||
# Note that this only applies to coordinators; hypervisor-only nodes restart immediately in
|
# Note that this only applies to coordinators; hypervisor-only nodes restart immediately in
|
||||||
# parallel, and the first two of three handlers do not apply to hypervisor-only nodes.
|
# parallel, and the first two of three handlers do not apply to hypervisor-only nodes.
|
||||||
- name: restart ceph-mon
|
- name: restart ceph-mon
|
||||||
shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ ansible_hostname }}.service{% endif %}"
|
shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ inventory_hostname.split('.')[0] }}.service{% endif %}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: restart ceph-mgr
|
- name: restart ceph-mgr
|
||||||
shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ ansible_hostname }}.service{% endif %}"
|
shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ inventory_hostname.split('.')[0] }}.service{% endif %}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: restart pvcnoded
|
- name: restart pvcnoded
|
||||||
shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[ansible_hostname].ansible_local.host_id|int - 1) }} &&{% endif %} systemctl restart pvcnoded.service"
|
shell: "{% if is_coordinator %}sleep {{ 15 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} &&{% endif %} systemctl restart pvcnoded.service"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: bootstrap is not defined
|
when: bootstrap is not defined
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- "[global]"
|
- "[global]"
|
||||||
- "fsid = {{ fsid }}"
|
- "fsid = {{ fsid }}"
|
||||||
- "mon initial members = {% for host in pvc_nodes if host.is_coordinator %}{{ host.hostname }}{% if not loop.last %},{% endif %}{% endfor %}"
|
- "mon initial members = {% for node in pvc_nodes if node.is_coordinator %}{{ node.hostname.split('.')[0] }}{% if not loop.last %},{% endif %}{% endfor %}"
|
||||||
- "mon host = {% for host in pvc_nodes if host.is_coordinator %}{{ host.storage_ip }}{% if not loop.last %},{% endif %}{% endfor %}"
|
- "mon host = {% for host in pvc_nodes if host.is_coordinator %}{{ host.storage_ip }}{% if not loop.last %},{% endif %}{% endfor %}"
|
||||||
|
|
||||||
- name: create temporary directory
|
- name: create temporary directory
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
command: ceph-authtool /tmp/ceph-bootstrap/ceph.mon.keyring --import-keyring /tmp/ceph-bootstrap/ceph.osd.bootstrap.keyring
|
command: ceph-authtool /tmp/ceph-bootstrap/ceph.mon.keyring --import-keyring /tmp/ceph-bootstrap/ceph.osd.bootstrap.keyring
|
||||||
|
|
||||||
- name: create monmap
|
- name: create monmap
|
||||||
command: monmaptool --create --fsid {{ fsid }} {% for node in pvc_nodes if node.is_coordinator %}--add {{ node.hostname }} {{ node.storage_ip }} {% endfor %} /tmp/ceph-bootstrap/monmap
|
command: monmaptool --create --fsid {{ fsid }} {% for node in pvc_nodes if node.is_coordinator %}--add {{ node.hostname.split('.')[0] }} {{ node.storage_ip }} {% endfor %} /tmp/ceph-bootstrap/monmap
|
||||||
|
|
||||||
- name: copy initial ceph.conf to the boostrap directory
|
- name: copy initial ceph.conf to the boostrap directory
|
||||||
copy:
|
copy:
|
||||||
|
|
Loading…
Reference in New Issue