|
5 | 5 | class telegraf::config inherits telegraf { |
6 | 6 | assert_private() |
7 | 7 |
|
| 8 | + $agent = { |
| 9 | + 'hostname' => $telegraf::hostname, |
| 10 | + 'omit_hostname' => $telegraf::omit_hostname, |
| 11 | + 'interval' => $telegraf::interval, |
| 12 | + 'round_interval' => $telegraf::round_interval, |
| 13 | + 'metric_batch_size' => $telegraf::metric_batch_size, |
| 14 | + 'metric_buffer_limit' => $telegraf::metric_buffer_limit, |
| 15 | + 'collection_jitter' => $telegraf::collection_jitter, |
| 16 | + 'flush_interval' => $telegraf::flush_interval, |
| 17 | + 'flush_jitter' => $telegraf::flush_jitter, |
| 18 | + 'precision' => $telegraf::precision, |
| 19 | + 'logfile' => $telegraf::logfile, |
| 20 | + 'debug' => $telegraf::debug, |
| 21 | + 'quiet' => $telegraf::quiet, |
| 22 | + } |
| 23 | + $config = to_toml({ 'global_tags' => $telegraf::global_tags, 'agent' => $agent, 'outputs' => $telegraf::outputs, 'inputs' => $telegraf::inputs }) |
8 | 24 | file { $telegraf::config_file: |
9 | 25 | ensure => $telegraf::ensure_file, |
10 | | - content => template('telegraf/telegraf.conf.erb'), |
| 26 | + content => $config, |
11 | 27 | owner => $telegraf::config_file_owner, |
12 | 28 | group => $telegraf::config_file_group, |
13 | 29 | mode => $telegraf::config_file_mode, |
|
0 commit comments