I am newbie to puppet, I have code like below in unix
log_exts=$(vgdisplay /dev/cassandra|grep Free|awk '{print $5}')
if lvcreate -n lv_cas -l ${log_exts} /dev/cassandra
then
mkfs -v -t ext4 /dev/cassandra/lv_cas
logit "Create LV file system"
fi
I want to convert this into puppet.
I should not use exec puppet command. so how can I grep for FREE and print the fifth column, then assign logical volume size.
Please help me