Fix a few more extraneous splits
Just use this_node if applicable, or the raw node.hostname.
This commit is contained in:
parent
87803cb7a2
commit
95b47f8b09
|
@ -1,5 +1,5 @@
|
||||||
iface ipmi inet manual
|
iface ipmi inet manual
|
||||||
pre-up ipmitool lan set 1 ipsrc static
|
pre-up ipmitool lan set 1 ipsrc static
|
||||||
pre-up ipmitool lan set 1 ipaddr {{ ipmi['hosts'][inventory_hostname.split('.')[0]]['address'] }}
|
pre-up ipmitool lan set 1 ipaddr {{ ipmi['hosts'][this_node]['address'] }}
|
||||||
pre-up ipmitool lan set 1 netmask {{ ipmi['hosts'][inventory_hostname.split('.')[0]]['netmask'] }}
|
pre-up ipmitool lan set 1 netmask {{ ipmi['hosts'][this_node]['netmask'] }}
|
||||||
pre-up ipmitool lan set 1 defgw ipaddr {{ ipmi['hosts'][inventory_hostname.split('.')[0]]['gateway'] }}
|
pre-up ipmitool lan set 1 defgw ipaddr {{ ipmi['hosts'][this_node]['gateway'] }}
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
# 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 {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ inventory_hostname.split('.')[0] }}.service{% endif %}"
|
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mon@{{ this_node }}.service{% endif %}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: restart ceph-mgr
|
- name: restart ceph-mgr
|
||||||
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ inventory_hostname.split('.')[0] }}.service{% endif %}"
|
shell: "{% if is_coordinator %}sleep {{ 30 * (hostvars[inventory_hostname].ansible_local.host_id|int - 1) }} && systemctl restart ceph-mgr@{{ this_node }}.service{% endif %}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: restart pvcnoded
|
- name: restart pvcnoded
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- "[global]"
|
- "[global]"
|
||||||
- "fsid = {{ fsid }}"
|
- "fsid = {{ fsid }}"
|
||||||
- "mon initial members = {% for node in pvc_nodes if node.is_coordinator %}{{ node.hostname.split('.')[0] }}{% if not loop.last %},{% endif %}{% endfor %}"
|
- "mon initial members = {% for node in pvc_nodes if node.is_coordinator %}{{ node.hostname }}{% 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.split('.')[0] }} {{ 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 }} {{ 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