$fact['mountpoints'] did it. Thanks.

--
Prentice


On 11/6/18 6:54 PM, 'Dan White' via Puppet Users wrote:
Try
$fact[‘mountpoints’]


On Nov 6, 2018, at 6:06 PM, pbisbal via Puppet Users <[email protected] <mailto:[email protected]>> wrote:

I want to check to see of a directory is a mount point for a separate partition. For example, I'd like to check to see if /tmp is a separate partition or is just part of the root partition on a Linux system. What is the best way to do this. I thought I could use the in operator to see if '/tmp' exists in $fact['partitions']['mount'], but that doesn't seem to work. For example, I tried this code, where /boot is definitely a separate partition, but /tmp is not:

class mount_points {
  if '/tmp' in $facts['partitions']['mount'] {
    notify { '/tmp is a separate partition': }
  }
  else {
    notify { '/tmp is NOT a separate partition': }
  }
  if "/boot" in $facts['partitions']['mount'] {
    notify { '/boot is a separate partition': }
  }
  else {
    notify { '/boot is NOT a separate partition': }
  }
}

Unfortunately, when I run this, puppet says both directories are NOT separate partitions. Is there something wrong with this syntax, or is this approach entirely wrong?

Prentice


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6d292a30-1ed0-4d60-93c8-80c65949c765%40googlegroups.com <https://groups.google.com/d/msgid/puppet-users/6d292a30-1ed0-4d60-93c8-80c65949c765%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4D2DD1DA-6019-4B72-B093-0483D4B51440%40icloud.com <https://groups.google.com/d/msgid/puppet-users/4D2DD1DA-6019-4B72-B093-0483D4B51440%40icloud.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/40c49d42-51cc-8051-8bb1-de98c1dd7171%40pppl.gov.
For more options, visit https://groups.google.com/d/optout.

Reply via email to