Use only short names in Ceph MON config

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:23 -04:00
parent 52862f9daf
commit c71415317a
2 changed files with 5 additions and 5 deletions

View File

@ -33,14 +33,14 @@
# 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.
- 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
- 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
- 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
when: bootstrap is not defined

View File

@ -21,7 +21,7 @@
with_items:
- "[global]"
- "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 %}"
- 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
- 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
copy: