mount lvm & auditd module(s) design?

62 views
Skip to first unread message

dkoleary

unread,
May 2, 2017, 12:56:58 PM5/2/17
to Puppet Users
Hey;

Core requirement: have puppet manage auditd on a separate /var/log/audit filesystem.

I've seen the mount resource so I can have the auditd module require the file/dir /var/log/audit (for permissions) which requires the mount point /var/log/audit which will, if necessary, update /etc/fstab.  I don't see any way to generate a new device using that, though. I can pre-generate that but I'd like to have puppet do it so it'll catch any new systems getting built.

Enter the puppetforge lvm module.  That looks cool.  The examples on the web show the mountpath and mountpath_require option but I can't tell if that'll update /etc/fstab.  Doesn't appear to.  

Anyone have any hints/tips/suggestions on having modules interact with mountpoints and linux lvm before I see if I can blow up a test box?

Thanks

Doug O'Leary

Joshua Schaeffer

unread,
May 4, 2017, 11:10:02 AM5/4/17
to Puppet Users
The mount resource has an "atboot" parameter. If set to true it will modify /etc/fstab and ensure that it gets mounted every time at boot. I have something similar for one of our manifests:

I create a logical volume, then a filesystem, then mount it. The mount option ensures that it gets mounted at boot.

# Create the logical volumes (LV) used on host automation servers.
# Create the LV and filesystem used for tool logging, then mount the filesystem.
logical_volume
{ 'hostauto-toollog':
 
ensure       => 'present',
  name        
=> $lvdata['toollog']['name'],
  volume_group
=> $profile::hostautomation::vgname,
  size        
=> $lvdata['toollog']['size'],
  before      
=> [Class['profile::hostautomation::directories'], Class['profile::symlinks']]
}


filesystem
{ 'hostauto-toollog':
 
ensure  => 'present',
  name    
=> "/dev/${profile::hostautomation::vgname}/${lvdata['toollog']['name']}",
  fs_type
=> $filesystem_type,
 
require => Logical_volume['hostauto-toollog'],
}


mount
{ 'hostauto-toollog':
 
ensure  => 'mounted',
  name    
=> $lvdata['toollog']['mountpoint'],
  atboot  
=> true,
  device  
=> "/dev/${profile::hostautomation::vgname}/${lvdata['toollog']['name']}",
  fstype  
=> $filesystem_type,
 
require => Filesystem['hostauto-toollog'],
}

Thanks,
Joshua Schaeffer
Reply all
Reply to author
Forward
0 new messages