Use UUID for mounted SwiftRawDisks
When SwiftRawDisks is set, try to mount the disks using uuids instead of
paths. This makes mounts more stable, eg. if a kernel gets updates and
device orders are changed.
This patch will also update existing entries in /etc/fstab and replaces
the device path with the corresponding UUID.
Change-Id: I275b962447015e804638ccf85c63a22d1bb6e3d6
(cherry picked from commit 6206d19592
)
This commit is contained in:
parent
8474feba63
commit
ea0cd3c37e
|
@ -633,10 +633,16 @@ outputs:
|
||||||
opts: -f -i size=1024
|
opts: -f -i size=1024
|
||||||
with_items: "{{ swift_raw_disks }}"
|
with_items: "{{ swift_raw_disks }}"
|
||||||
when: swift_raw_disks
|
when: swift_raw_disks
|
||||||
|
- name: Refresh facts if SwiftRawDisks is set to get uuids if newly created partitions
|
||||||
|
setup:
|
||||||
|
gather_subset:
|
||||||
|
- '!all'
|
||||||
|
- 'hardware'
|
||||||
|
when: swift_raw_disks
|
||||||
- name: Mount devices defined in SwiftRawDisks
|
- name: Mount devices defined in SwiftRawDisks
|
||||||
mount:
|
mount:
|
||||||
name: /srv/node/{{ item }}
|
name: /srv/node/{{ item }}
|
||||||
src: "{{ swift_raw_disks[item]['base_dir']|default('/dev') }}/{{ item }}"
|
src: "{% if lsblk.results['uuids'][item] is defined %}UUID={{ ansible_device_links['uuids'][item][0] }}{% else %}{{ swift_raw_disks[item]['base_dir']|default('/dev') }}/{{ item }}{% endif %}"
|
||||||
fstype: xfs
|
fstype: xfs
|
||||||
opts: noatime
|
opts: noatime
|
||||||
state: mounted
|
state: mounted
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
When SwiftRawDisks is set, try to mount the disks using uuids instead of
|
||||||
|
paths. This makes mounts more stable, eg. if a kernel gets updates and
|
||||||
|
device orders are changed.
|
Loading…
Reference in New Issue