Does it ever make sense to ensure a file is both present and file? Does present imply it's a file or does the file { '/etc/sendmail':
line define it as a file?
class sendmail {
file { '/etc/sendmail':
ensure => directory,
mode => 755
}
file { '/etc/sendmail/sendmail.cf':
ensure => present,
ensure => file,
backup => false,
source => 'puppet:///mymodules/sendmail/sendmail.cf',
}
file { '/etc/sendmail/submit.cf':
ensure => present,
ensure => file,
backup => false,
source => 'puppet:///mymodules/sendmail/submit.cf',
}
service {'sendmail':
ensure => running
}
}
ensure => file
implies ensure => present
. That is to say the resource should be a file and if is not a file or does not exist, create a file.
ensure => present
just means that the resource should be a file, directory, or link; if it does not exist, create a file.
So to answer your question: no, it does not make sense to do so.
For more information about ensure
, check out the documentation for the file type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With