Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Commit 01a8f32

Browse files
committed
Merge pull request #280 from echocat/develop
back merge for 6.0.3
2 parents 2e81de6 + 4aaa8e5 commit 01a8f32

17 files changed

+483
-211
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 2016-04-17 - 6.0.3 (Bugfix release)
2+
3+
#### Bugfixes:
4+
5+
- (1deb7f9) point Apache to the right WSGI file
6+
- (e01e6bc) ensure that graphiteweb_storage_dir is created
7+
- (5e7ce00) properly parameterize gunicorn --chdir option on redhat
8+
- (6f7fb67) notify web service for local_settings.py and graphite_wsgi.py
9+
- (1f49faf) add unit tests
10+
- (7042ddf) Update fail message when gr_web_server = none
11+
12+
#### Features:
13+
14+
- (1aa40af) patch graphite module to support UDP listener in [relay] section
15+
116
## 2016-04-11 - 6.0.2 (Bugfix release)
217

318
#### Bugfixes:

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ apache::vhost { graphite.my.domain:
9898
display-name => '%{GROUP}',
9999
inactivity-timeout => '120',
100100
},
101-
wsgi_import_script => '/opt/graphite/conf/graphite.wsgi',
101+
wsgi_import_script => '/opt/graphite/conf/graphite_wsgi.py',
102102
wsgi_import_script_options => {
103103
process-group => 'graphite',
104104
application-group => '%{GLOBAL}'
105105
},
106106
wsgi_process_group => 'graphite',
107107
wsgi_script_aliases => {
108-
'/' => '/opt/graphite/conf/graphite.wsgi'
108+
'/' => '/opt/graphite/conf/graphite_wsgi.py'
109109
},
110110
headers => [
111111
'set Access-Control-Allow-Origin "*"',
@@ -571,6 +571,18 @@ Default is '0.0.0.0' (string)
571571

572572
Default is 2013 (integer)
573573

574+
#####`gr_relay_enable_udp_listener`
575+
576+
Default is 'False'. Enables the UDP listener for carbon-relay.
577+
578+
#####`gr_relay_udp_receiver_interface`
579+
580+
Default is '0.0.0.0' (string)
581+
582+
#####`gr_relay_udp_receiver_port`
583+
584+
Default is 2013 (integer)
585+
574586
#####`gr_relay_pickle_interface`
575587

576588
Default is '0.0.0.0' (string)

manifests/config.pp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# python-django-tagging, python-simplejson
1717
# optional: python-ldap, python-memcache, memcached, python-sqlite
1818

19-
if ($::graphite::params::service_provider == 'redhat' and $::operatingsystemrelease =~ /^7\.\d+/) or (
19+
if ($::osfamily == 'RedHat' and $::operatingsystemrelease =~ /^7\.\d+/) or (
2020
$::graphite::params::service_provider == 'debian' and $::operatingsystemmajrelease =~ /8|15\.10/) {
2121
$initscript_notify = [Exec['graphite-reload-systemd'],]
2222

@@ -37,6 +37,7 @@
3737
$gr_web_group_REAL = pick($::graphite::gr_web_group, $::graphite::params::apache_web_group)
3838
include graphite::config_apache
3939
$web_server_package_require = [Package[$::graphite::params::apache_pkg]]
40+
$web_server_service_notify = Service[$::graphite::params::apache_service_name]
4041
}
4142

4243
'nginx' : {
@@ -46,6 +47,7 @@
4647
include graphite::config_gunicorn
4748
include graphite::config_nginx
4849
$web_server_package_require = [Package['nginx']]
50+
$web_server_service_notify = Service['gunicorn']
4951
}
5052

5153
'wsgionly' : {
@@ -62,11 +64,12 @@
6264
'none' : {
6365
# Don't configure apache, gunicorn or nginx. Leave all webserver configuration to something external.
6466
if !$::graphite::gr_web_user or !$::graphite::gr_web_group {
65-
fail('having $gr_web_server => \'wsgionly\' requires use of $gr_web_user and $gr_web_group')
67+
fail('Having $gr_web_server => \'none\' requires use of $gr_web_user and $gr_web_group to set correct file owner for your own webserver setup.')
6668
}
6769
$gr_web_user_REAL = pick($::graphite::gr_web_user)
6870
$gr_web_group_REAL = pick($::graphite::gr_web_group)
6971
$web_server_package_require = undef
72+
$web_server_service_notify = undef
7073
}
7174

7275
default : {
@@ -109,6 +112,7 @@
109112
$::graphite::rrd_dir_REAL,
110113
$::graphite::whitelists_dir_REAL,
111114
$::graphite::graphiteweb_log_dir_REAL,
115+
$::graphite::graphiteweb_storage_dir_REAL,
112116
"${::graphite::base_dir_REAL}/bin"]:
113117
ensure => directory,
114118
group => $gr_web_group_REAL,
@@ -158,20 +162,23 @@
158162
group => $gr_web_group_REAL,
159163
mode => '0644',
160164
owner => $gr_web_user_REAL,
161-
require => $web_server_package_require;
165+
require => $web_server_package_require,
166+
notify => $web_server_service_notify;
162167

163168
"${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py":
164169
ensure => file,
165170
content => template('graphite/opt/graphite/conf/graphite.wsgi.erb'),
166171
group => $gr_web_group_REAL,
167172
mode => '0644',
168173
owner => $gr_web_user_REAL,
169-
require => $web_server_package_require;
174+
require => $web_server_package_require,
175+
notify => $web_server_service_notify;
170176

171177
"${::graphite::graphiteweb_install_lib_dir_REAL}/graphite_wsgi.py":
172178
ensure => link,
173179
target => "${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py",
174-
require => File["${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py"];
180+
require => File["${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py"],
181+
notify => $web_server_service_notify;
175182
}
176183

177184
if $::graphite::gr_remote_user_header_name {

manifests/config_apache.pp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@
6161
}
6262
}
6363

64+
# Create the log dir if it doesn't exist
65+
file { $::graphite::gr_apache_logdir:
66+
ensure => directory,
67+
group => $::graphite::config::gr_web_group_REAL,
68+
mode => '0644',
69+
owner => $::graphite::config::gr_web_user_REAL,
70+
require => Package[$::graphite::params::apache_pkg],
71+
before => Service[$::graphite::params::apache_service_name]
72+
}
73+
6474
# fix graphite's race condition on start
6575
# if the exec fails, assume we're using a version of graphite that doesn't need it
6676
file { '/tmp/fix-graphite-race-condition.py':
@@ -91,8 +101,6 @@
91101
hasstatus => true;
92102
}
93103

94-
95-
96104
# Deploy configfiles
97105
file {
98106
"${::graphite::params::apache_dir}/ports.conf":

manifests/config_gunicorn.pp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
# configs. Each config is stored as a separate file in /etc/gunicorn.d/.
2020
# On debian 8 and Ubuntu 15.10, which use systemd, the gunicorn-debian
2121
# config file has to be installed before the gunicorn package.
22-
file { '/etc/gunicorn.d/':
22+
# TODO: special cases for deb 8 and ubuntu 15.10
23+
file { '/etc/gunicorn.d':
2324
ensure => directory,
2425
}
2526
file { '/etc/gunicorn.d/graphite':
@@ -35,7 +36,8 @@
3536
$package_name = 'python-gunicorn'
3637

3738
# RedHat package is missing initscript
38-
if $::graphite::params::service_provider == 'systemd' {
39+
# RedHat 7+ uses systemd
40+
if $::operatingsystemrelease =~ /^7\.\d+/ {
3941

4042
file { '/etc/systemd/system/gunicorn.service':
4143
ensure => file,
@@ -55,6 +57,7 @@
5557
mode => '0644',
5658
}
5759

60+
# TODO: we should use the exec graphite-reload-systemd from config class
5861
exec { 'gunicorn-reload-systemd':
5962
command => 'systemctl daemon-reload',
6063
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
@@ -66,7 +69,7 @@
6669
before => Service['gunicorn']
6770
}
6871

69-
} elsif $::graphite::params::service_provider == 'redhat' {
72+
} else {
7073

7174
file { '/etc/init.d/gunicorn':
7275
ensure => file,
@@ -125,7 +128,7 @@
125128
$package_name:
126129
ensure => installed,
127130
require => [
128-
File[$graphite::gr_pid_dir],
131+
File[$graphite::storage_dir_REAL],
129132
File[$graphite::graphiteweb_log_dir_REAL],
130133
Exec['Initial django db creation'],
131134
];

manifests/init.pp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@
186186
# Default is '0.0.0.0'
187187
# [*gr_relay_line_port*]
188188
# Default is 2013.
189+
# [*gr_relay_enable_udp_listener*]
190+
# Set this to True to enable the UDP listener.
191+
# Default is False.
192+
# [*gr_relay_udp_receiver_interface*]
193+
# Its clear, isnt it?
194+
# Default is 0.0.0.0
195+
# [*gr_relay_udp_receiver_port*]
196+
# Self explaining.
197+
# Default is 2013
189198
# [*gr_relay_pickle_interface*]
190199
# Default is '0.0.0.0'
191200
# [*gr_relay_pickle_port*]
@@ -586,6 +595,9 @@
586595
$gr_enable_carbon_relay = false,
587596
$gr_relay_line_interface = '0.0.0.0',
588597
$gr_relay_line_port = 2013,
598+
$gr_relay_enable_udp_listener = 'False',
599+
$gr_relay_udp_receiver_interface = '0.0.0.0',
600+
$gr_relay_udp_receiver_port = 2013,
589601
$gr_relay_pickle_interface = '0.0.0.0',
590602
$gr_relay_pickle_port = 2014,
591603
$gr_relay_log_listener_connections = 'True',
@@ -671,7 +683,7 @@
671683
$gr_graphiteweb_webapp_dir = undef,
672684
$gr_graphiteweb_storage_dir = '/var/lib/graphite-web',
673685
$gr_graphiteweb_install_lib_dir = undef,
674-
$gr_apache_logdir = '/var/log/httpd/graphite-web',
686+
$gr_apache_logdir = $::graphite::params::apache_logdir_graphite,
675687
$gunicorn_arg_timeout = 30,
676688
$gunicorn_bind = 'unix:/var/run/graphite.sock',
677689
$gunicorn_workers = 2,

manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
$apache_wsgi_socket_prefix = '/var/run/apache2/wsgi'
4848
$apacheconf_dir = '/etc/apache2/sites-available'
4949
$apacheports_file = 'ports.conf'
50+
$apache_logdir_graphite = '/var/log/apache2/graphite-web'
5051
$service_provider = undef
5152

5253
$nginxconf_dir = '/etc/nginx/sites-available'
@@ -94,6 +95,7 @@
9495
$apache_wsgi_socket_prefix = 'run/wsgi'
9596
$apacheconf_dir = '/etc/httpd/conf.d'
9697
$apacheports_file = 'graphite_ports.conf'
98+
$apache_logdir_graphite = '/var/log/httpd/graphite-web'
9799
$service_provider = 'redhat'
98100

99101
$nginxconf_dir = '/etc/nginx/conf.d'

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dwerder-graphite",
3-
"version": "6.0.2",
3+
"version": "6.0.3",
44
"source": "https://github.com/echocat/puppet-graphite.git",
55
"author": "Daniel Werdermann",
66
"license": "Apache-2.0",

spec/classes/config_spec.rb

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)