Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Managing partitions

$
0
0
I am creating a module to create and manage filesystems. I have everything working from physical volumes to mounting the filesystem. I am utilizing a puppetforge module called [LVM][1]. This module works great except for the fact that it does not manage the partition table at all. If you do a pvcreate with this module (or as a standalone command) you can create a physical volume without partitioning a disk. This does work however if you do an fdisk -l you will see that there are no partitions on that disk (because none were created). I would like to somehow manage partitions so that it provides more clarity on what that disk is being used for. **Is there a puppet module/command/function that I can use to help manage partitions?** I created an exec that will do it but it feels "dirty" and I feel like there are cleaner solutions. thanks, My disk partitioner for reference: #Where ${disk} is sdb1, sdc1, etc. disks.each |$disk| { exec { "part_${disk}": command => "/usr/sbin/parted -a optimal -- /dev/${disk} unit compact mkpart primary \"1\" \"-1\" ; /bin/sleep 1", unless => "/sbin/fdisk -l | grep /dev/${disk}", } } [1]: https://forge.puppet.com/puppetlabs/lvm "lvm"

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>