mirror of
				https://github.com/krislamo/puppet-fluentd
				synced 2025-11-04 02:38:35 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			458 B
		
	
	
	
		
			Puppet
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			458 B
		
	
	
	
		
			Puppet
		
	
	
	
	
	
# Configure a fluentd source
 | 
						|
#
 | 
						|
define fluentd::source (
 | 
						|
  $ensure   = present,
 | 
						|
  $priority = 10,
 | 
						|
  $config   = {},
 | 
						|
) {
 | 
						|
 | 
						|
  # parameter validation
 | 
						|
  if ! ($ensure in [ 'present', 'absent' ]) {
 | 
						|
    fail('ensure parameter must be present or absent')
 | 
						|
  }
 | 
						|
  validate_integer($priority)
 | 
						|
  validate_hash($config)
 | 
						|
 | 
						|
  fluentd::config::file { "source-${title}":
 | 
						|
    ensure   => $ensure,
 | 
						|
    priority => $priority,
 | 
						|
    content  => template( 'fluentd/source.erb'),
 | 
						|
  }
 | 
						|
}
 |