I have below linux script
cre_disk=$(ls /dev/sd[b-z])
for disk in $cre_isk
do
pvcreate $i
done
My understanding from the above code is, it is checking the sdb,sdc..sdz disk file. if it exist, then do physical volume creation.
what my requirement is, need to convert the above linux into puppet(lvm creation). I know the command for physical volume creation
physical volume{'/dev/sdb':
ensure => 'present'
}
I am not sure how to check the physical disk (cre_disk=$(ls /dev/sd[b-z])). is there any resource available or puppet would take care without any resource.
NOTE:I have posted this same question in different format in previous question post. Please ignore the topic, the topic name is "check physical disk directory"
Best Answer
Facter's variable partitions:
could be used within an if statement as follows:
Outcome