From 8dcea812455afdbc7a3a04c73e7d8c1948292a93 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Mon, 19 Nov 2018 15:27:13 +0100 Subject: [PATCH] add variable for config_file_mode und config_folder_mode --- manifests/config.pp | 4 ++-- manifests/init.pp | 10 +++++++++- manifests/params.pp | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 5c41044..74138fb 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -12,7 +12,7 @@ content => template('telegraf/telegraf.conf.erb'), owner => $::telegraf::config_file_owner, group => $::telegraf::config_file_group, - mode => '0640', + mode => $::telegraf::config_file_mode, notify => Class['::telegraf::service'], require => Class['::telegraf::install'], ; @@ -20,7 +20,7 @@ ensure => directory, owner => $::telegraf::config_file_owner, group => $::telegraf::config_file_group, - mode => '0770', + mode => $::telegraf::config_folder_mode, purge => $::telegraf::purge_config_fragments, recurse => true, notify => Class['::telegraf::service'], diff --git a/manifests/init.pp b/manifests/init.pp index e65e715..db60971 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -23,8 +23,14 @@ # [*config_file_group*] # String. Group to own the telegraf config file. # +# [*config_file_mode*] +# String. File mode for the telegraf config file. +# # [*config_folder*] -# String. Path of additional telegraf config files. +# String. Path of additional telegraf config folder. +# +# [*config_folder_mode*] +# String. File mode for the telegraf config folder. # # [*hostname*] # String. Override default hostname used to identify this agent. @@ -95,7 +101,9 @@ String $config_file = $telegraf::params::config_file, String $config_file_owner = $telegraf::params::config_file_owner, String $config_file_group = $telegraf::params::config_file_group, + String $config_file_mode = $telegraf::params::config_file_mode, String $config_folder = $telegraf::params::config_folder, + String $config_folder_mode = $telegraf::params::config_folder_mode, String $hostname = $telegraf::params::hostname, Boolean $omit_hostname = $telegraf::params::omit_hostname, String $interval = $telegraf::params::interval, diff --git a/manifests/params.pp b/manifests/params.pp index 32c3b46..d87b8ac 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,7 +19,9 @@ $config_file = '/etc/telegraf/telegraf.conf' $config_file_owner = 'telegraf' $config_file_group = 'telegraf' + $config_file_mode = '0640' $config_folder = '/etc/telegraf/telegraf.d' + $config_folder_mode = '0770' $logfile = '' $manage_repo = true $repo_location = 'https://repos.influxdata.com/'