This is verry old code that I am extneralizing. My hope is to refactor alot of it to more digestable providers, and to leverage the LWRP for LVM.
Create mount and add to fstab filesystems defined from attributes by default filesystems will be created, added to the fstab and mounted. Unless atribs are set to tell it otherwise
Currently there is no remove or delete options for filesystems.
- xfs cookbook when building xfs filesystems
- ocfs2 cookbook when creating ocfs2 filesystems
Data bag to look for node[:fqdn]
item describing this nodes filesystems
Hash of filesytems to setup
Each Filesytem's key is the FS Label
: This explains each key in a filesystem entry
name of the Volume group to create this under
used the disk uuid to identify what disk to make this on
path to the device
size paramater as would be passed to lvcrate -l ( XX[g|m|t|p] ) only needed when vg is specified. and we want the lv created.
Options to pass to mkfs.xfs (defaults to xfs atm)
Options to add to the mount command (also added to fstab)
Where to mount this filesystem. (will mkdir -p first)
mount this fs ?
make the filesystem or not
Add entry to fstab
create logical volume
role some_role.json:
{
"override_attributes": {
"filesystems": {
"db": {
"vg": "vg01",
"size": "50g",
"mount_point": "/db",
"mount_optons": "noatime, nobarrier",
"mkfs_options": "-d sunit=128,swidth=2048"
},
"cluster_01": {
"type": "ocfs2",
"device": "/dev/mpath/ocfs01",
"mount_point": "/mnt/test"
}
}
}
}
This creates 2 filesystems one thats /dev/vg01/db and one thats an ocfs2 volume from multipath named device ocfs01
the Logical volume for db will be created from volume group vg01 if it doesn't already exists this lv will the be formated as xfs with d sunit=128,swidth=2048 options, and mounted on /db (added to fstab etc etc)