Hi guys. So i have a problem i couldn’t find an answer to. It’s hard to describe, but i try.
Problem:
I want to partition and install the OS in my SSD and use ansible later to partition my HDD.
I am using this ruby-code in my partition-template to find my SSD
<%ssd = nil%>
<%if @host.facts['blockdevices'] != nil %>
<%devices = @host.facts['blockdevices'].split(',')%>
<%end%>
<%if devices != nil%>
<%for device in devices%>
# Device = <%=device%>
# Size = <%=@host.facts['blockdevice_' + device +'_size']%>
# Model = <%=@host.facts['blockdevice_' + device +'_model']%>
<%model=@host.facts['blockdevice_' + device +'_model']%>
<%if model == 'SK hynix SC311 S'%> <%ssd = device%> <%end%>
<%end%>
# SSD found in <%=ssd%>
<%end%>
# select disks for partman
d-i partman-auto/disk string /dev/<%=ssd%>
If i use the preview Button i see:
Device = sda
Size = 256060514304
Model = SK hynix SC311 S
Device = sdb
Size = 1000204886016
Model = ST1000LM049-2GH1
Device = sdc
Size = 0
Model = SD/MMC CRW
Device = sr0
Size = 1073741312
Model = DVD+-RW GU90N
# SSD found in sda
# select disks for partman
d-i partman-auto/disk string /dev/sda
Expected outcome:
Building a Host should partition the SSD.
Actual outcome
It Stops at [!!] Partition Disks with Error: No root file system
looking at the available disks it now tells me my SSD is sdb and my HDD sdc. sda is not listed. My suspicion is, that it take the alphabetical order (as found under /dev/disks/by-id) and puts the DVD drive as sda.
How should i change my Code, so this won"t occur?
Thanks in advance