Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,21 @@
}

# configure logrotate script for carbon
file { "${::graphite::base_dir_REAL}/bin/carbon-logrotate.sh":
ensure => file,
mode => '0544',
content => template('graphite/opt/graphite/bin/carbon-logrotate.sh.erb'),
}
if $::graphite::gr_enable_logrotation {
file { "${::graphite::base_dir_REAL}/bin/carbon-logrotate.sh":
ensure => file,
mode => '0544',
content => template('graphite/opt/graphite/bin/carbon-logrotate.sh.erb'),
}

cron { 'Rotate carbon logs':
command => "${::graphite::base_dir_REAL}/bin/carbon-logrotate.sh",
hour => 3,
minute => 15,
require => File["${::graphite::base_dir_REAL}/bin/carbon-logrotate.sh"],
user => root,
cron { 'Rotate carbon logs':
command => "${::graphite::base_dir_REAL}/bin/carbon-logrotate.sh",
hour => 3,
minute => 15,
require => File["${::graphite::base_dir_REAL}/bin/carbon-logrotate.sh"],
user => root,
}
}

# startup carbon engine

if $::graphite::gr_enable_carbon_cache {
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@
# Boolean. Should the caching of the webapp be disabled. This helps with some
# display issues in grafana.
# Default: false
# [*gr_enable_logrotation*]
# Boolean. Sets up a cronjob to rotate carbon and webapp logs.
# [*gr_apache_port*]
# DEPRECATED. Use `gr_web_server_port` now. Trying to set this variable will
# cause puppet to fail.
Expand Down Expand Up @@ -750,6 +752,7 @@
$gr_pip_install = true,
$gr_manage_python_packages = true,
$gr_disable_webapp_cache = false,
$gr_enable_logrotation = true,
$gr_carbonlink_query_bulk = undef,
$gr_carbonlink_hosts_timeout = '1.0',
$gr_rendering_hosts = undef,
Expand Down
15 changes: 14 additions & 1 deletion templates/opt/graphite/webapp/graphite/local_settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,20 @@ CONTENT_DIR = '<%= scope.lookupvar('graphite::graphiteweb_webapp_dir_REAL') %>/c
# NOTE: If any directory is unreadable in DATA_DIRS it will break metric browsing
WHISPER_DIR = '<%= scope.lookupvar('graphite::local_data_dir_REAL') %>'
RRD_DIR = '<%= scope.lookupvar('graphite::rrd_dir_REAL') %>'
#DATA_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
<%
if scope.lookupvar('graphite::gr_cache_instances')
cache_instances = scope.lookupvar('graphite::gr_cache_instances')
end
whisper_dirs = Array.new
#if cache_instances != nil
cache_instances.each do |name, params|
if params["LOCAL_DATA_DIR"] then
whisper_dirs << params["LOCAL_DATA_DIR"]
end
end
unless whisper_dirs.empty? %>
DATA_DIRS = [WHISPER_DIR, RRD_DIR,<%= whisper_dirs.map{|s| "'#{s}'" }.join(',') %>] # Default: set from the above variables
<% end -%>
LOG_DIR = '<%= scope.lookupvar('graphite::graphiteweb_log_dir_REAL') %>'
#INDEX_FILE = '/opt/graphite/storage/index' # Search index file

Expand Down