In full disclaimer I am a bit of a neophyte with Ansible and I might be biting off more than I can chew, but I have a need to be able to configure IO servers. Think of them as the front-end servers for Gluster, or Lustre OSS servers, etc... Each of these servers has 10 drives. I can configure a single drive using
- name: VGCreate vg_gluster1
lvg: vg={{ "vg_gluster1" }} pvs={{ "/dev/sdb" }} state=present
- name: LVCreate vg_gluster1
lvol: vg={{ "vg_gluster1" }} lv={{ "brick1" }} size={{ "1000m" }}
- name: Create Filesystem vg_gluster1
filesystem: fstype={{ "xfs" }} dev={{ "/dev/vg_gluster1/brick1" }}
- name: Create Mount Points vg_gluster1
file: path={{ "/brick1" }} state=directory mode=0777 recurse=yes
- name: Mount Filesystem vg_gluster1
mount: name={{ "/brick1" }} src={{ "/dev/vg_gluster1/brick1" }} state=mounted fstype=xfs
I would like to understand how to loop over all 10 drives, keeping in mind that vg_gluster1 is associated with /dev/sdb, vg_gluster2 with sdc, etc... Does anyone have any insight to help out?
Thanks!!