Commit fc782668 authored by Alain Takoudjou's avatar Alain Takoudjou

vm-bootstrap playbook: configure disks only once

parent b2fd7c04
Pipeline #4099 skipped
......@@ -6,6 +6,12 @@ for i in a b c d e f g h i j k l m n o p q r s t u
do
if [ -e "/dev/vd$i" ]
then
if [ -s "/etc/opt/disks" ]; then
MOUNTED=$(cat /etc/opt/disks | grep vd$i)
if [ ! -z "$MOUNTED" ]; then
continue
fi
fi
R=$(ls /dev/vd$i | cut -d '/' -f3)
RESULT="$RESULT $R"
fi
......
......@@ -30,3 +30,5 @@
- name: Mount /data{{ data_n }}
mount: name=/data{{ data_n }} src=/dev/vd{{ vd_disk }}1 fstype=ext4 state=mounted
when: partition_vd_created.stat.exists == True
- lineinfile: dest=/etc/opt/disks state=present line="vd{{ vd_disk }}" create=yes
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment