Using 2 puppetforge modules it is possible to configure LVM and docker engine.
https://forge.puppet.com/puppetlabs/lvm https://forge.puppet.com/puppetlabs/docker
I was unable to find any documentation on configuring direct-lvm though, but in the end it's not as complicated as I thought:
class { 'lvm': volume_groups => { 'docker' => { physical_volumes => [ '/dev/sdb', ], logical_volumes => { 'thinpool' => {'extents' => '95%VG', 'thinpool' => true, 'createfs' => false}, }, }, }, } -> class { 'docker': version => 'latest', manage_kernel => false, storage_driver => 'devicemapper', dm_thinpooldev => '/dev/mapper/docker-thinpool', }
# docker info ... Storage Driver: devicemapper Pool Name: docker-thinpool Pool Blocksize: 262.1kB Base Device Size: 10.74GB Backing Filesystem: xfs Data file: Metadata file: