diff --git a/manifests/configfile.pp b/manifests/configfile.pp index eb8c9719..c903e64d 100644 --- a/manifests/configfile.pp +++ b/manifests/configfile.pp @@ -2,6 +2,10 @@ # # Parameters are mutually exclusive. Only one should be specified. # +# @param [String] ensure +# Ensure the file is either [`present`,`absent`]. +# Useful if you want to place the file on some servers but specifically not on (or remove from) other servers +# # @param [String] content # Literal content to be placed in the file. # @@ -42,6 +46,7 @@ # @author https://github.com/elastic/puppet-logstash/graphs/contributors # define logstash::configfile ( + Enum['present', 'absent'] $ensure = $logstash::ensure, $content = undef, $source = undef, $template = undef, @@ -64,6 +69,7 @@ if($config) { file { $config_file: + ensure => $ensure, content => $config, owner => $owner, group => $group, @@ -74,6 +80,7 @@ } elsif($source) { file { $config_file: + ensure => $ensure, source => $source, owner => $owner, group => $group, diff --git a/manifests/patternfile.pp b/manifests/patternfile.pp index 4490ff15..fe85b53a 100644 --- a/manifests/patternfile.pp +++ b/manifests/patternfile.pp @@ -20,6 +20,7 @@ # @author https://github.com/elastic/puppet-logstash/graphs/contributors # define logstash::patternfile ( + $ensure = $::logstash::ensure, Pattern[/^(puppet|file):\/\//] $source = undef, Optional[String[1]] $filename = undef, ) { @@ -28,7 +29,7 @@ $destination = pick($filename, basename($source)) file { "${logstash::config_dir}/patterns/${destination}": - ensure => file, + ensure => $ensure, source => $source, owner => 'root', group => $logstash::logstash_group,