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

Commit

Permalink
Merge pull request #280 from echocat/develop
Browse files Browse the repository at this point in the history
back merge for 6.0.3
  • Loading branch information
dwerder committed Apr 17, 2016
2 parents 2e81de6 + 4aaa8e5 commit 01a8f32
Show file tree
Hide file tree
Showing 17 changed files with 483 additions and 211 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 2016-04-17 - 6.0.3 (Bugfix release)

#### Bugfixes:

- (1deb7f9) point Apache to the right WSGI file
- (e01e6bc) ensure that graphiteweb_storage_dir is created
- (5e7ce00) properly parameterize gunicorn --chdir option on redhat
- (6f7fb67) notify web service for local_settings.py and graphite_wsgi.py
- (1f49faf) add unit tests
- (7042ddf) Update fail message when gr_web_server = none

#### Features:

- (1aa40af) patch graphite module to support UDP listener in [relay] section

## 2016-04-11 - 6.0.2 (Bugfix release)

#### Bugfixes:
Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ apache::vhost { graphite.my.domain:
display-name => '%{GROUP}',
inactivity-timeout => '120',
},
wsgi_import_script => '/opt/graphite/conf/graphite.wsgi',
wsgi_import_script => '/opt/graphite/conf/graphite_wsgi.py',
wsgi_import_script_options => {
process-group => 'graphite',
application-group => '%{GLOBAL}'
},
wsgi_process_group => 'graphite',
wsgi_script_aliases => {
'/' => '/opt/graphite/conf/graphite.wsgi'
'/' => '/opt/graphite/conf/graphite_wsgi.py'
},
headers => [
'set Access-Control-Allow-Origin "*"',
Expand Down Expand Up @@ -571,6 +571,18 @@ Default is '0.0.0.0' (string)

Default is 2013 (integer)

#####`gr_relay_enable_udp_listener`

Default is 'False'. Enables the UDP listener for carbon-relay.

#####`gr_relay_udp_receiver_interface`

Default is '0.0.0.0' (string)

#####`gr_relay_udp_receiver_port`

Default is 2013 (integer)

#####`gr_relay_pickle_interface`

Default is '0.0.0.0' (string)
Expand Down
17 changes: 12 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# python-django-tagging, python-simplejson
# optional: python-ldap, python-memcache, memcached, python-sqlite

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

Expand All @@ -37,6 +37,7 @@
$gr_web_group_REAL = pick($::graphite::gr_web_group, $::graphite::params::apache_web_group)
include graphite::config_apache
$web_server_package_require = [Package[$::graphite::params::apache_pkg]]
$web_server_service_notify = Service[$::graphite::params::apache_service_name]
}

'nginx' : {
Expand All @@ -46,6 +47,7 @@
include graphite::config_gunicorn
include graphite::config_nginx
$web_server_package_require = [Package['nginx']]
$web_server_service_notify = Service['gunicorn']
}

'wsgionly' : {
Expand All @@ -62,11 +64,12 @@
'none' : {
# Don't configure apache, gunicorn or nginx. Leave all webserver configuration to something external.
if !$::graphite::gr_web_user or !$::graphite::gr_web_group {
fail('having $gr_web_server => \'wsgionly\' requires use of $gr_web_user and $gr_web_group')
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.')
}
$gr_web_user_REAL = pick($::graphite::gr_web_user)
$gr_web_group_REAL = pick($::graphite::gr_web_group)
$web_server_package_require = undef
$web_server_service_notify = undef
}

default : {
Expand Down Expand Up @@ -109,6 +112,7 @@
$::graphite::rrd_dir_REAL,
$::graphite::whitelists_dir_REAL,
$::graphite::graphiteweb_log_dir_REAL,
$::graphite::graphiteweb_storage_dir_REAL,
"${::graphite::base_dir_REAL}/bin"]:
ensure => directory,
group => $gr_web_group_REAL,
Expand Down Expand Up @@ -158,20 +162,23 @@
group => $gr_web_group_REAL,
mode => '0644',
owner => $gr_web_user_REAL,
require => $web_server_package_require;
require => $web_server_package_require,
notify => $web_server_service_notify;

"${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py":
ensure => file,
content => template('graphite/opt/graphite/conf/graphite.wsgi.erb'),
group => $gr_web_group_REAL,
mode => '0644',
owner => $gr_web_user_REAL,
require => $web_server_package_require;
require => $web_server_package_require,
notify => $web_server_service_notify;

"${::graphite::graphiteweb_install_lib_dir_REAL}/graphite_wsgi.py":
ensure => link,
target => "${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py",
require => File["${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py"];
require => File["${::graphite::graphiteweb_conf_dir_REAL}/graphite_wsgi.py"],
notify => $web_server_service_notify;
}

if $::graphite::gr_remote_user_header_name {
Expand Down
12 changes: 10 additions & 2 deletions manifests/config_apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
}
}

# Create the log dir if it doesn't exist
file { $::graphite::gr_apache_logdir:
ensure => directory,
group => $::graphite::config::gr_web_group_REAL,
mode => '0644',
owner => $::graphite::config::gr_web_user_REAL,
require => Package[$::graphite::params::apache_pkg],
before => Service[$::graphite::params::apache_service_name]
}

# fix graphite's race condition on start
# if the exec fails, assume we're using a version of graphite that doesn't need it
file { '/tmp/fix-graphite-race-condition.py':
Expand Down Expand Up @@ -91,8 +101,6 @@
hasstatus => true;
}



# Deploy configfiles
file {
"${::graphite::params::apache_dir}/ports.conf":
Expand Down
11 changes: 7 additions & 4 deletions manifests/config_gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# configs. Each config is stored as a separate file in /etc/gunicorn.d/.
# On debian 8 and Ubuntu 15.10, which use systemd, the gunicorn-debian
# config file has to be installed before the gunicorn package.
file { '/etc/gunicorn.d/':
# TODO: special cases for deb 8 and ubuntu 15.10
file { '/etc/gunicorn.d':
ensure => directory,
}
file { '/etc/gunicorn.d/graphite':
Expand All @@ -35,7 +36,8 @@
$package_name = 'python-gunicorn'

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

file { '/etc/systemd/system/gunicorn.service':
ensure => file,
Expand All @@ -55,6 +57,7 @@
mode => '0644',
}

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

} elsif $::graphite::params::service_provider == 'redhat' {
} else {

file { '/etc/init.d/gunicorn':
ensure => file,
Expand Down Expand Up @@ -125,7 +128,7 @@
$package_name:
ensure => installed,
require => [
File[$graphite::gr_pid_dir],
File[$graphite::storage_dir_REAL],
File[$graphite::graphiteweb_log_dir_REAL],
Exec['Initial django db creation'],
];
Expand Down
14 changes: 13 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@
# Default is '0.0.0.0'
# [*gr_relay_line_port*]
# Default is 2013.
# [*gr_relay_enable_udp_listener*]
# Set this to True to enable the UDP listener.
# Default is False.
# [*gr_relay_udp_receiver_interface*]
# Its clear, isnt it?
# Default is 0.0.0.0
# [*gr_relay_udp_receiver_port*]
# Self explaining.
# Default is 2013
# [*gr_relay_pickle_interface*]
# Default is '0.0.0.0'
# [*gr_relay_pickle_port*]
Expand Down Expand Up @@ -586,6 +595,9 @@
$gr_enable_carbon_relay = false,
$gr_relay_line_interface = '0.0.0.0',
$gr_relay_line_port = 2013,
$gr_relay_enable_udp_listener = 'False',
$gr_relay_udp_receiver_interface = '0.0.0.0',
$gr_relay_udp_receiver_port = 2013,
$gr_relay_pickle_interface = '0.0.0.0',
$gr_relay_pickle_port = 2014,
$gr_relay_log_listener_connections = 'True',
Expand Down Expand Up @@ -671,7 +683,7 @@
$gr_graphiteweb_webapp_dir = undef,
$gr_graphiteweb_storage_dir = '/var/lib/graphite-web',
$gr_graphiteweb_install_lib_dir = undef,
$gr_apache_logdir = '/var/log/httpd/graphite-web',
$gr_apache_logdir = $::graphite::params::apache_logdir_graphite,
$gunicorn_arg_timeout = 30,
$gunicorn_bind = 'unix:/var/run/graphite.sock',
$gunicorn_workers = 2,
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
$apache_wsgi_socket_prefix = '/var/run/apache2/wsgi'
$apacheconf_dir = '/etc/apache2/sites-available'
$apacheports_file = 'ports.conf'
$apache_logdir_graphite = '/var/log/apache2/graphite-web'
$service_provider = undef

$nginxconf_dir = '/etc/nginx/sites-available'
Expand Down Expand Up @@ -94,6 +95,7 @@
$apache_wsgi_socket_prefix = 'run/wsgi'
$apacheconf_dir = '/etc/httpd/conf.d'
$apacheports_file = 'graphite_ports.conf'
$apache_logdir_graphite = '/var/log/httpd/graphite-web'
$service_provider = 'redhat'

$nginxconf_dir = '/etc/nginx/conf.d'
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dwerder-graphite",
"version": "6.0.2",
"version": "6.0.3",
"source": "https://github.com/echocat/puppet-graphite.git",
"author": "Daniel Werdermann",
"license": "Apache-2.0",
Expand Down
126 changes: 0 additions & 126 deletions spec/classes/config_spec.rb

This file was deleted.

Loading

0 comments on commit 01a8f32

Please sign in to comment.