From 8f55da407fed1f58129e4820e7236c1d3f2f6ae0 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 17 Feb 2022 11:41:56 -0800 Subject: [PATCH] Retire this repo The opendev project has been moving away from puppet and this is one of the puppet modules that is no longer used. To simplify things for us we are taking the extra step of retiring this repo. Change-Id: Ibbd66faf35447c5e8587c6996cd5011fcede688a --- .gitignore | 5 - Gemfile | 15 - LICENSE | 202 ---------- README.md | 10 +- Rakefile | 8 - bindep.txt | 11 - files/carbon-cache.init | 99 ----- files/graphite-init-db.py | 43 -- files/statsd.default | 2 - files/statsd.init | 157 -------- manifests/init.pp | 375 ------------------ metadata.json | 12 - spec/acceptance/basic_spec.rb | 154 ------- spec/acceptance/fixtures/default.pp | 6 - spec/acceptance/fixtures/postconditions.pp | 7 - spec/acceptance/nodesets/default.yml | 11 - spec/acceptance/nodesets/nodepool-centos7.yml | 10 - spec/acceptance/nodesets/nodepool-trusty.yml | 10 - spec/acceptance/nodesets/nodepool-xenial.yml | 10 - templates/admin.ini | 4 - templates/carbon.conf.erb | 285 ------------- templates/config.js.erb | 63 --- templates/graphite.ssl.vhost.erb | 73 ---- templates/graphite.vhost.erb | 69 ---- templates/graphite.wsgi.django17.erb | 15 - templates/graphite.wsgi.erb | 16 - templates/local_settings.py.erb | 4 - templates/storage-aggregation.conf.erb | 24 -- templates/storage-schemas.conf.erb | 15 - 29 files changed, 7 insertions(+), 1708 deletions(-) delete mode 100644 .gitignore delete mode 100644 Gemfile delete mode 100644 LICENSE delete mode 100644 Rakefile delete mode 100644 bindep.txt delete mode 100644 files/carbon-cache.init delete mode 100644 files/graphite-init-db.py delete mode 100644 files/statsd.default delete mode 100644 files/statsd.init delete mode 100644 manifests/init.pp delete mode 100644 metadata.json delete mode 100644 spec/acceptance/basic_spec.rb delete mode 100644 spec/acceptance/fixtures/default.pp delete mode 100644 spec/acceptance/fixtures/postconditions.pp delete mode 100644 spec/acceptance/nodesets/default.yml delete mode 100644 spec/acceptance/nodesets/nodepool-centos7.yml delete mode 100644 spec/acceptance/nodesets/nodepool-trusty.yml delete mode 100644 spec/acceptance/nodesets/nodepool-xenial.yml delete mode 100644 templates/admin.ini delete mode 100644 templates/carbon.conf.erb delete mode 100644 templates/config.js.erb delete mode 100644 templates/graphite.ssl.vhost.erb delete mode 100644 templates/graphite.vhost.erb delete mode 100644 templates/graphite.wsgi.django17.erb delete mode 100644 templates/graphite.wsgi.erb delete mode 100644 templates/local_settings.py.erb delete mode 100644 templates/storage-aggregation.conf.erb delete mode 100644 templates/storage-schemas.conf.erb diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ea90996..0000000 --- a/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -Gemfile.lock -.bundled_gems/ -log/ -junit/ -.vagrant/ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 019213a..0000000 --- a/Gemfile +++ /dev/null @@ -1,15 +0,0 @@ -source 'https://rubygems.org' - -if File.exists?('/home/zuul/src/git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper') - gem_checkout_method = {:path => '/home/zuul/src/git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper'} -else - gem_checkout_method = {:git => 'https://git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper'} -end -gem_checkout_method[:require] = false - -group :development, :test, :system_tests do - gem 'puppet-openstack_infra_spec_helper', - gem_checkout_method -end - -# vim:ft=ruby diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d645695..0000000 --- a/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md index 617a68f..ec889a9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ -# OpenStack Graphite Module +This project is no longer maintained. -## Overview +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". -Configures Graphite. +For any further questions, please email +service-discuss@lists.opendev.org or join #opendev on OFTC. diff --git a/Rakefile b/Rakefile deleted file mode 100644 index ff1f0d7..0000000 --- a/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -require 'rubygems' -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' -PuppetLint.configuration.fail_on_warnings = true -PuppetLint.configuration.send('disable_80chars') -PuppetLint.configuration.send('disable_autoloader_layout') -PuppetLint.configuration.send('disable_class_inherits_from_params_class') -PuppetLint.configuration.send('disable_class_parameter_defaults') diff --git a/bindep.txt b/bindep.txt deleted file mode 100644 index 7cdd58e..0000000 --- a/bindep.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This is a cross-platform list tracking distribution packages needed by tests; -# see http://docs.openstack.org/infra/bindep/ for additional information. - -libxml2-devel [test platform:rpm] -libxml2-dev [test platform:dpkg] -libxslt-devel [test platform:rpm] -libxslt1-dev [test platform:dpkg] -ruby-devel [test platform:rpm] -ruby-dev [test platform:dpkg] -zlib1g-dev [test platform:dpkg] -zlib-devel [test platform:rpm] diff --git a/files/carbon-cache.init b/files/carbon-cache.init deleted file mode 100644 index 54fe98b..0000000 --- a/files/carbon-cache.init +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -### BEGIN INIT INFO -# Provides: carbon-cache -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Carbon Cache -# Description: Carbon Cache -### END INIT INFO - -CARBON_DAEMON="cache" -NAME="carbon-${CARBON_DAEMON}" - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -INSTANCES=`grep "^\[${CARBON_DAEMON}" /etc/graphite/carbon.conf | cut -d \[ -f 2 | cut -d \] -f 1 | cut -d : -f 2` - -function die { - echo $1 - exit 1 -} - -start(){ - for INSTANCE in ${INSTANCES}; do - if [ "${INSTANCE}" == "${CARBON_DAEMON}" ]; then - INSTANCE="a"; - fi; - echo "Starting carbon-${CARBON_DAEMON}:${INSTANCE}..." - /usr/local/bin/carbon-${CARBON_DAEMON}.py --config /etc/graphite/carbon.conf --instance=${INSTANCE} start; - - if [ $? -eq 0 ]; then - echo "success" - else - echo "failure" - fi; - echo "" - done; -} - -stop(){ - for INSTANCE in ${INSTANCES}; do - if [ "${INSTANCE}" == "${CARBON_DAEMON}" ]; then - INSTANCE="a"; - fi; - echo "Stopping carbon-${CARBON_DAEMON}:${INSTANCE}..." - /usr/local/bin/carbon-${CARBON_DAEMON}.py --config /etc/graphite/carbon.conf --instance=${INSTANCE} stop - - if [ `sleep 3; /usr/bin/pgrep -f "carbon-${CARBON_DAEMON}.py --instance=${INSTANCE}" | /usr/bin/wc -l` -gt 0 ]; then - echo "Carbon did not stop yet. Sleeping longer, then force killing it..."; - sleep 20; - /usr/bin/pkill -9 -f "carbon-${CARBON_DAEMON}.py --instance=${INSTANCE}"; - fi; - - if [ $? -eq 0 ]; then - echo "success" - else - echo "failure" - fi; - echo "" - done; -} - -status(){ - for INSTANCE in ${INSTANCES}; do - if [ "${INSTANCE}" == "${CARBON_DAEMON}" ]; then - INSTANCE="a"; - fi; - /usr/local/bin/carbon-${CARBON_DAEMON}.py --config /etc/graphite/carbon.conf --instance=${INSTANCE} status; - done; -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart|reload) - stop - start - ;; - *) - echo $"Usage: $0 {start|stop|restart|status}" - exit 1 -esac - diff --git a/files/graphite-init-db.py b/files/graphite-init-db.py deleted file mode 100644 index 119572a..0000000 --- a/files/graphite-init-db.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# Copyright 2012 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import os -# Must happen before django imports -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphite.settings") - -import sys -import ConfigParser - -import django -from django.core import management -from django.contrib.auth import models as auth_models - -django.setup() - -config = ConfigParser.ConfigParser() -config.read(os.path.expanduser(sys.argv[1])) - -USER = config.get('admin', 'user') -EMAIL = config.get('admin', 'email') -PASS = config.get('admin', 'password') - -management.call_command('syncdb', interactive=False) - -try: - auth_models.User.objects.get(username=USER) - print 'Admin user already exists.' -except auth_models.User.DoesNotExist: - print 'Creating admin user' - auth_models.User.objects.create_superuser(USER, EMAIL, PASS) diff --git a/files/statsd.default b/files/statsd.default deleted file mode 100644 index fd509c5..0000000 --- a/files/statsd.default +++ /dev/null @@ -1,2 +0,0 @@ -DAEMON_ARGS="/opt/statsd/stats.js /etc/statsd/config.js" -CHDIR="/opt/statsd" diff --git a/files/statsd.init b/files/statsd.init deleted file mode 100644 index 7a9dda2..0000000 --- a/files/statsd.init +++ /dev/null @@ -1,157 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: statsd -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -### END INIT INFO - -# Do NOT "set -e" - -PATH=$PATH:/usr/local/bin:/usr/bin:/bin -NODE_BIN=$(which nodejs||which node) - -if [ ! -x "$NODE_BIN" ]; then - echo "Can't find executable nodejs or node in PATH=$PATH" - exit 1 -fi - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="StatsD" -NAME=statsd -DAEMON=$NODE_BIN -DAEMON_ARGS="/usr/share/statsd/stats.js /etc/statsd/localConfig.js 2>&1 >> /var/log/statsd/statsd.log " -PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/$NAME -CHDIR="/usr/share/statsd" -USER=statsd - -# Exit if the package is not installed -# [ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet -m --pidfile $PIDFILE -c $USER --startas $DAEMON --background --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet -m --pidfile $PIDFILE -c $USER --startas $DAEMON --background --chdir $CHDIR -- \ - $DAEMON_ARGS > /dev/null 2> /var/log/$NAME-stderr.log \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=0/0/KILL/5 --pidfile $PIDFILE - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - # Many daemons don't delete their pidfiles when they exit. - rm -f $PIDFILE - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/manifests/init.pp b/manifests/init.pp deleted file mode 100644 index 71d3247..0000000 --- a/manifests/init.pp +++ /dev/null @@ -1,375 +0,0 @@ -# == Class: graphite -# -class graphite( - $graphite_admin_email, - $graphite_admin_password, - $graphite_admin_user, - $storage_schemas = [ - { - 'name' => 'carbon', - 'pattern' => '^carbon\.', - 'retentions' => '60:90d', - }, - { - 'name' => 'stats.timers', - 'pattern' => '^stats.timers.*', - 'retentions' => '10s:8h,60s:7d,1h:90d,1d:1y', - }, - { - 'name' => 'stats', - 'pattern' => '^stats.*', - 'retentions' => '10s:8h,60s:7d,1h:1y,1d:5y', - }, - { - 'name' => 'default', - 'pattern' => '.*', - 'retentions' => '60:90d', - } - ], - $vhost_name = $::fqdn, - # Have statsd listen on '::' which, thanks to dual-stack, - # gets ipv4 and ipv6 connections. - $statsd_ipv6_listen = true, - - $ssl_cert_file = '', - $ssl_chain_file = '', - $ssl_key_file = '', -) { - $packages = [ 'python-django', - 'python-django-tagging', - 'python-cairo', - 'nodejs', - 'python-tz' ] - - include ::httpd - include ::pip - - include ::httpd::mod::wsgi - - # The Apache mod_version module only needs to be enabled on Ubuntu 12.04 - # as it comes compiled and enabled by default on newer OS, including CentOS - if !defined(Httpd::Mod['version']) and $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '12.04' { - httpd::mod { 'version': ensure => present } - } - - package { $packages: - ensure => present, - } - - if $::operatingsystemrelease == '12.04' { - # pin version because of https://github.com/graphite-project/graphite-web/issues/650 - $graphite_rev = '7f8c33da809e2938df55c1ff57ab5329d8d7b878' - } - else { - $graphite_rev = '0.9.x' - } - - vcsrepo { '/opt/graphite-web': - ensure => present, - provider => git, - revision => $graphite_rev, - source => 'https://github.com/graphite-project/graphite-web.git', - } - - # Install data to /usr/local/share because it's example data and - # we don't want pip to know about our real data location - exec { 'install_graphite_web' : - command => 'pip install --install-option="--install-scripts=/usr/local/bin" --install-option="--install-lib=/usr/local/lib/python2.7/dist-packages" --install-option="--install-data=/usr/local/share/graphite" /opt/graphite-web', - path => '/usr/local/bin:/usr/bin:/bin', - refreshonly => true, - subscribe => Vcsrepo['/opt/graphite-web'], - require => [Class['pip'], - Exec['install_carbon'], - File['/var/lib/graphite/storage']] - } - - vcsrepo { '/opt/carbon': - ensure => latest, - provider => git, - revision => '0.9.x', - source => 'https://github.com/graphite-project/carbon.git', - } - - # Install data to /usr/local/share because it's example data and - # we don't want pip to know about our real data location - exec { 'install_carbon' : - command => 'pip install --install-option="--install-scripts=/usr/local/bin" --install-option="--install-lib=/usr/local/lib/python2.7/dist-packages" --install-option="--install-data=/usr/local/share/graphite" /opt/carbon', - path => '/usr/local/bin:/usr/bin:/bin', - refreshonly => true, - subscribe => Vcsrepo['/opt/carbon'], - require => [Class['pip'], - Exec['install_whisper'], - File['/var/lib/graphite/storage']] - } - - vcsrepo { '/opt/whisper': - ensure => latest, - provider => git, - revision => 'master', - source => 'https://github.com/graphite-project/whisper.git', - } - - if ! defined(Package['build-essential']) { - package { 'build-essential': - ensure => present, - } - } - - exec { 'install_whisper' : - command => 'pip install /opt/whisper', - path => '/usr/local/bin:/usr/bin:/bin/', - refreshonly => true, - subscribe => Vcsrepo['/opt/whisper'], - require => [ - Class['pip'], - Package['build-essential'], - ], - } - - user { 'statsd': - ensure => present, - home => '/home/statsd', - shell => '/bin/bash', - gid => 'statsd', - managehome => true, - require => Group['statsd'], - } - - group { 'statsd': - ensure => present, - } - - file { '/var/lib/graphite': - ensure => directory, - } - - file { '/var/lib/graphite/webapp': - ensure => directory, - require => [File['/var/lib/graphite']], - } - - file { '/var/lib/graphite/webapp/content': - ensure => directory, - source => '/opt/graphite-web/webapp/content', - recurse => true, - require => [File['/var/lib/graphite/webapp'], - Vcsrepo['/opt/graphite-web']], - } - - file { '/var/lib/graphite/storage': - ensure => directory, - owner => 'www-data', - group => 'www-data', - require => [Class['httpd'], - File['/var/lib/graphite']] - } - - file { '/var/lib/graphite/storage/log': - ensure => directory, - owner => 'www-data', - group => 'www-data', - require => File['/var/lib/graphite/storage'], - } - - file { '/var/lib/graphite/storage/rrd': - ensure => directory, - owner => 'www-data', - group => 'www-data', - require => File['/var/lib/graphite/storage'], - } - - file { '/var/lib/graphite/storage/whisper': - ensure => directory, - owner => 'www-data', - group => 'www-data', - require => File['/var/lib/graphite/storage'], - } - - file { '/var/log/graphite': - ensure => directory, - owner => 'www-data', - group => 'www-data', - require => Class['httpd'], - } - - file { '/var/log/graphite/carbon-cache-a': - ensure => directory, - owner => 'www-data', - group => 'www-data', - require => File['/var/log/graphite'], - } - - include ::logrotate - logrotate::file { 'graphite-carbon': - log => '/var/log/graphite/carbon-cache-a/*.log', - options => [ - 'compress', - 'nocreate', - 'missingok', - 'rotate 7', - 'daily', - 'notifempty', - 'sharedscripts', - ], - } - - file { '/etc/graphite': - ensure => directory, - } - - exec { 'graphite_sync_db': - user => 'www-data', - command => 'python /usr/local/bin/graphite-init-db.py /etc/graphite/admin.ini', - cwd => '/usr/local/lib/python2.7/dist-packages/graphite', - path => '/bin:/usr/bin', - onlyif => 'test ! -f /var/lib/graphite/storage/graphite.db', - require => [ Exec['install_graphite_web'], - File['/var/lib/graphite'], - Class['httpd'], - File['/usr/local/lib/python2.7/dist-packages/graphite/local_settings.py'], - File['/usr/local/bin/graphite-init-db.py'], - File['/etc/graphite/admin.ini']], - } - - if $ssl_cert_file != '' { - $http_template = 'graphite/graphite.ssl.vhost.erb' - } else { - $http_template = 'graphite/graphite.vhost.erb' - } - - ::httpd::vhost { $vhost_name: - port => 80, - priority => '50', - docroot => '/var/lib/graphite/webapp', - template => $http_template, - } - - if !defined(Httpd::Mod['headers']) { - ::httpd::mod { 'headers': - ensure => present, - } - } - - vcsrepo { '/opt/statsd': - ensure => latest, - provider => git, - source => 'https://github.com/etsy/statsd.git', - } - - file { '/etc/statsd': - ensure => directory, - } - - file { '/etc/statsd/config.js': - owner => 'statsd', - group => 'statsd', - mode => '0444', - content => template('graphite/config.js.erb'), - require => File['/etc/statsd'], - } - - file { '/etc/graphite/carbon.conf': - mode => '0444', - content => template('graphite/carbon.conf.erb'), - require => File['/etc/graphite'], - } - - # later versions of django require a different wsgi loader; swap it - # in here for > trusty - case $::operatingsystem { - 'Ubuntu': { - if versioncmp($::operatingsystemrelease, '14.04') <= 0 { - $django_wsgi_template = 'graphite.wsgi.erb' - } - else { - $django_wsgi_template = 'graphite.wsgi.django17.erb' - } - } - default: { - fail('Platform not supported') - } - } - - file { '/etc/graphite/graphite.wsgi': - mode => '0444', - content => template("graphite/${django_wsgi_template}"), - require => File['/etc/graphite'], - } - - file { '/etc/graphite/storage-schemas.conf': - mode => '0444', - content => template('graphite/storage-schemas.conf.erb'), - require => File['/etc/graphite'], - } - - file { '/etc/graphite/storage-aggregation.conf': - mode => '0444', - content => template('graphite/storage-aggregation.conf.erb'), - require => File['/etc/graphite'], - } - - file { '/usr/local/lib/python2.7/dist-packages/graphite/local_settings.py': - mode => '0444', - content => template('graphite/local_settings.py.erb'), - require => Exec['install_graphite_web'], - } - - file { '/usr/local/bin/graphite-init-db.py': - mode => '0555', - source => 'puppet:///modules/graphite/graphite-init-db.py' - } - - file { '/etc/graphite/admin.ini': - mode => '0400', - owner => 'www-data', - group => 'www-data', - content => template('graphite/admin.ini'), - require => [ File['/etc/graphite'], - Class['httpd']], - } - - file { '/etc/init.d/carbon-cache': - mode => '0555', - source => 'puppet:///modules/graphite/carbon-cache.init' - } - - file { '/etc/init.d/statsd': - mode => '0555', - source => 'puppet:///modules/graphite/statsd.init' - } - - file { '/etc/default/statsd': - mode => '0444', - source => 'puppet:///modules/graphite/statsd.default' - } - - service { 'carbon-cache': - name => 'carbon-cache', - enable => true, - hasrestart => true, - require => [File['/etc/init.d/carbon-cache'], - File['/etc/graphite/carbon.conf'], - Exec['install_carbon']], - } - - service { 'statsd': - name => 'statsd', - enable => true, - hasrestart => true, - require => [File['/etc/init.d/statsd'], - File['/etc/statsd/config.js'], - Vcsrepo['/opt/statsd']], - } - - # remove any stats that haven't been updated for ~9 months and - # remove empty dirs - cron { 'remove_old_stats': - user => 'root', - hour => '2', - minute => '0', - command => 'find /var/lib/graphite/storage/whisper -type f -mtime +270 -name \*.wsp -delete; find /var/lib/graphite/storage/whisper -depth -type d -empty -delete > /dev/null', - environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', - } - -} - diff --git a/metadata.json b/metadata.json deleted file mode 100644 index db41213..0000000 --- a/metadata.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "openstackinfra-graphite", - "version": "0.0.1", - "author": "OpenStack CI", - "summary": "Puppet module for Graphite", - "license": "Apache 2.0", - "source": "https://git.openstack.org/openstack-infra/puppet-graphite.git", - "project_page": "http://docs.openstack.org/infra/system-config/", - "issues_url": "https://storyboard.openstack.org/#!/project/774", - "dependencies": [ - ] -} diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb deleted file mode 100644 index 8dbd680..0000000 --- a/spec/acceptance/basic_spec.rb +++ /dev/null @@ -1,154 +0,0 @@ -require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance' - -describe 'puppet-graphite module', :if => ['debian', 'ubuntu'].include?(os[:family]) do - def pp_path - base_path = File.dirname(__FILE__) - File.join(base_path, 'fixtures') - end - - def default_puppet_module - module_path = File.join(pp_path, 'default.pp') - File.read(module_path) - end - - def postconditions_puppet_module - module_path = File.join(pp_path, 'postconditions.pp') - File.read(module_path) - end - - it 'should work with no errors' do - apply_manifest(default_puppet_module, catch_failures: true) - end - - it 'should be idempotent' do - apply_manifest(default_puppet_module, catch_changes: true) - end - - it 'should enable the services' do - apply_manifest(postconditions_puppet_module, catch_failures: true) - end - - describe 'required packages' do - required_packages = [ - package('python-django'), - package('python-django-tagging'), - package('python-cairo'), - package('nodejs') - ] - - required_packages.each do |package| - describe package do - it { should be_installed } - end - end - end - - describe 'required files' do - required_git_repos = [ - file('/opt/graphite-web/.git'), - file('/opt/carbon/.git'), - file('/opt/whisper/.git'), - file('/opt/statsd/.git'), - ] - required_git_repos.each do |git_directory| - describe git_directory do - it { should be_directory } - end - end - - required_graphite_directories = [ - file('/var/lib/graphite/storage/log'), - file('/var/lib/graphite/storage/rrd'), - file('/var/lib/graphite/storage/whisper'), - file('/var/log/graphite'), - file('/var/log/graphite/carbon-cache-a'), - ] - required_graphite_directories.each do |graphite_directory| - describe graphite_directory do - it { should be_directory } - it { should be_owned_by 'www-data' } - it { should be_grouped_into 'www-data' } - end - end - - describe file('/etc/logrotate.d/graphite-carbon') do - its(:content) { should include '/var/log/graphite/carbon-cache-a/*.log' } - end - - describe file('/etc/statsd/config.js') do - it { should be_file } - it { should be_owned_by 'statsd' } - it { should be_grouped_into 'statsd' } - its(:content) { should include 'graphitePort: 2003' } - its(:content) { should include "address: '::'" } - - end - - describe file('/etc/graphite/carbon.conf') do - it { should be_file } - its(:content) { should include 'USER = www-data' } - end - - describe file('/etc/graphite/graphite.wsgi') do - it { should be_file } - its(:content) { should include "sys.path.append('/var/lib/graphite/webapp')" } - end - - describe file('/etc/graphite/storage-schemas.conf') do - it { should be_file } - its(:content) { should include '["carbon"]' } - end - - describe file('/etc/graphite/storage-aggregation.conf') do - it { should be_file } - its(:content) { should include '[stats_counts]' } - end - - describe file('/usr/local/lib/python2.7/dist-packages/graphite/local_settings.py') do - it { should be_file } - its(:content) { should include "CONF_DIR = '/etc/graphite/'" } - end - - describe file('/usr/local/bin/graphite-init-db.py') do - it { should be_file } - its(:content) { should include "management.call_command('syncdb', interactive=False)" } - end - - describe file('/etc/graphite/admin.ini') do - it { should be_file } - it { should be_owned_by 'www-data' } - it { should be_grouped_into 'www-data' } - its(:content) { should include 'email=graphite@localhost' } - end - - describe file('/etc/init.d/carbon-cache') do - it { should be_file } - its(:content) { should include '# Short-Description: Carbon Cache' } - end - - describe file('/etc/init.d/statsd') do - it { should be_file } - its(:content) { should include '# Provides: statsd' } - end - - describe file('/etc/default/statsd') do - it { should be_file } - its(:content) { should include 'DAEMON_ARGS="/opt/statsd/stats.js /etc/statsd/config.js"' } - its(:content) { should include 'CHDIR="/opt/statsd"' } - end - end - - describe 'required services' do - describe service('carbon-cache') do - it { should be_enabled } - end - - describe service('statsd') do - it { should be_enabled } - end - end - - describe cron do - it { should have_entry('0 2 * * * find /var/lib/graphite/storage/whisper -type f -mtime +270 -name \*.wsp -delete; find /var/lib/graphite/storage/whisper -depth -type d -empty -delete > /dev/null').with_user('root') } - end -end diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp deleted file mode 100644 index ce185ec..0000000 --- a/spec/acceptance/fixtures/default.pp +++ /dev/null @@ -1,6 +0,0 @@ -class { '::graphite': - graphite_admin_user => 'graphite', - graphite_admin_email => 'graphite@localhost', - graphite_admin_password => '12345', - vhost_name => '*', -} diff --git a/spec/acceptance/fixtures/postconditions.pp b/spec/acceptance/fixtures/postconditions.pp deleted file mode 100644 index c73919e..0000000 --- a/spec/acceptance/fixtures/postconditions.pp +++ /dev/null @@ -1,7 +0,0 @@ -exec { 'starting carbon-cache service': - command => '/etc/init.d/carbon-cache start', -} - -exec { 'starting statsd service': - command => '/etc/init.d/statsd start', -} diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml deleted file mode 100644 index 3bb3e62..0000000 --- a/spec/acceptance/nodesets/default.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - ubuntu-server-1404-x64: - roles: - - master - platform: ubuntu-14.04-amd64 - box: puppetlabs/ubuntu-14.04-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm - hypervisor: vagrant -CONFIG: - log_level: debug - type: git diff --git a/spec/acceptance/nodesets/nodepool-centos7.yml b/spec/acceptance/nodesets/nodepool-centos7.yml deleted file mode 100644 index c552874..0000000 --- a/spec/acceptance/nodesets/nodepool-centos7.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-70-x64: - roles: - - master - platform: el-7-x86_64 - hypervisor: none - ip: 127.0.0.1 -CONFIG: - type: foss - set_env: false diff --git a/spec/acceptance/nodesets/nodepool-trusty.yml b/spec/acceptance/nodesets/nodepool-trusty.yml deleted file mode 100644 index 9fc624e..0000000 --- a/spec/acceptance/nodesets/nodepool-trusty.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-14.04-amd64: - roles: - - master - platform: ubuntu-14.04-amd64 - hypervisor: none - ip: 127.0.0.1 -CONFIG: - type: foss - set_env: false diff --git a/spec/acceptance/nodesets/nodepool-xenial.yml b/spec/acceptance/nodesets/nodepool-xenial.yml deleted file mode 100644 index 99dd318..0000000 --- a/spec/acceptance/nodesets/nodepool-xenial.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-16.04-amd64: - roles: - - master - platform: ubuntu-16.04-amd64 - hypervisor: none - ip: 127.0.0.1 -CONFIG: - type: foss - set_env: false diff --git a/templates/admin.ini b/templates/admin.ini deleted file mode 100644 index 4f9d2ab..0000000 --- a/templates/admin.ini +++ /dev/null @@ -1,4 +0,0 @@ -[admin] -user=<%= @graphite_admin_user %> -email=<%= @graphite_admin_email %> -password=<%= @graphite_admin_password %> diff --git a/templates/carbon.conf.erb b/templates/carbon.conf.erb deleted file mode 100644 index 8d5a9a3..0000000 --- a/templates/carbon.conf.erb +++ /dev/null @@ -1,285 +0,0 @@ -[cache] -# Configure carbon directories. -# -# OS environment variables can be used to tell carbon where graphite is -# installed, where to read configuration from and where to write data. -# -# GRAPHITE_ROOT - Root directory of the graphite installation. -# Defaults to ../ -# GRAPHITE_CONF_DIR - Configuration directory (where this file lives). -# Defaults to $GRAPHITE_ROOT/conf/ -# GRAPHITE_STORAGE_DIR - Storage directory for whipser/rrd/log/pid files. -# Defaults to $GRAPHITE_ROOT/storage/ -# -# To change other directory paths, add settings to this file. The following -# configuration variables are available with these default values: -# -# STORAGE_DIR = $GRAPHITE_STORAGE_DIR -# LOCAL_DATA_DIR = STORAGE_DIR/whisper/ -# WHITELISTS_DIR = STORAGE_DIR/lists/ -# CONF_DIR = STORAGE_DIR/conf/ -# LOG_DIR = STORAGE_DIR/log/ -# PID_DIR = STORAGE_DIR/ -# -# For FHS style directory structures, use: -# -STORAGE_DIR = /var/lib/graphite/storage/ -CONF_DIR = /etc/graphite/ -LOG_DIR = /var/log/graphite/ -PID_DIR = /var/run/ -LOCAL_DATA_DIR = /var/lib/graphite/storage/whisper/ -# -#LOCAL_DATA_DIR = /opt/graphite/storage/whisper/ - -# Enable daily log rotation. If disabled, a new file will be opened whenever the log file path no -# longer exists (i.e. it is removed or renamed) -ENABLE_LOGROTATION = False - -# Specify the user to drop privileges to -# If this is blank carbon runs as the user that invokes it -# This user must have write access to the local data directory -USER = www-data - -# Limit the size of the cache to avoid swapping or becoming CPU bound. -# Sorts and serving cache queries gets more expensive as the cache grows. -# Use the value "inf" (infinity) for an unlimited cache size. -MAX_CACHE_SIZE = inf - -# Limits the number of whisper update_many() calls per second, which effectively -# means the number of write requests sent to the disk. This is intended to -# prevent over-utilizing the disk and thus starving the rest of the system. -# When the rate of required updates exceeds this, then carbon's caching will -# take effect and increase the overall throughput accordingly. -MAX_UPDATES_PER_SECOND = 500 - -# Softly limits the number of whisper files that get created each minute. -# Setting this value low (like at 50) is a good way to ensure your graphite -# system will not be adversely impacted when a bunch of new metrics are -# sent to it. The trade off is that it will take much longer for those metrics' -# database files to all get created and thus longer until the data becomes usable. -# Setting this value high (like "inf" for infinity) will cause graphite to create -# the files quickly but at the risk of slowing I/O down considerably for a while. -MAX_CREATES_PER_MINUTE = 60 - -LINE_RECEIVER_INTERFACE = 0.0.0.0 -LINE_RECEIVER_PORT = 2003 - -# Set this to True to enable the UDP listener. By default this is off -# because it is very common to run multiple carbon daemons and managing -# another (rarely used) port for every carbon instance is not fun. -ENABLE_UDP_LISTENER = False -UDP_RECEIVER_INTERFACE = 0.0.0.0 -UDP_RECEIVER_PORT = 2003 - -PICKLE_RECEIVER_INTERFACE = 0.0.0.0 -PICKLE_RECEIVER_PORT = 2004 - -# Per security concerns outlined in Bug #817247 the pickle receiver -# will use a more secure and slightly less efficient unpickler. -# Set this to True to revert to the old-fashioned insecure unpickler. -USE_INSECURE_UNPICKLER = False - -CACHE_QUERY_INTERFACE = 0.0.0.0 -CACHE_QUERY_PORT = 7002 - -# Set this to False to drop datapoints received after the cache -# reaches MAX_CACHE_SIZE. If this is True (the default) then sockets -# over which metrics are received will temporarily stop accepting -# data until the cache size falls below 95% MAX_CACHE_SIZE. -USE_FLOW_CONTROL = True - -# By default, carbon-cache will log every whisper update. This can be excessive and -# degrade performance if logging on the same volume as the whisper data is stored. -LOG_UPDATES = False - -# On some systems it is desirable for whisper to write synchronously. -# Set this option to True if you'd like to try this. Basically it will -# shift the onus of buffering writes from the kernel into carbon's cache. -WHISPER_AUTOFLUSH = False - -# By default new Whisper files are created pre-allocated with the data region -# filled with zeros to prevent fragmentation and speed up contiguous reads and -# writes (which are common). Enabling this option will cause Whisper to create -# the file sparsely instead. Enabling this option may allow a large increase of -# MAX_CREATES_PER_MINUTE but may have longer term performance implications -# depending on the underlying storage configuration. -# WHISPER_SPARSE_CREATE = False - -# Enabling this option will cause Whisper to lock each Whisper file it writes -# to with an exclusive lock (LOCK_EX, see: man 2 flock). This is useful when -# multiple carbon-cache daemons are writing to the same files -# WHISPER_LOCK_WRITES = False - -# Set this to True to enable whitelisting and blacklisting of metrics in -# CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or -# empty, all metrics will pass through -# USE_WHITELIST = False - -# By default, carbon itself will log statistics (such as a count, -# metricsReceived) with the top level prefix of 'carbon' at an interval of 60 -# seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation -# CARBON_METRIC_PREFIX = carbon -# CARBON_METRIC_INTERVAL = 60 - -# Enable AMQP if you want to receve metrics using an amqp broker -# ENABLE_AMQP = False - -# Verbose means a line will be logged for every metric received -# useful for testing -# AMQP_VERBOSE = False - -# AMQP_HOST = localhost -# AMQP_PORT = 5672 -# AMQP_VHOST = / -# AMQP_USER = guest -# AMQP_PASSWORD = guest -# AMQP_EXCHANGE = graphite -# AMQP_METRIC_NAME_IN_BODY = False - -# The manhole interface allows you to SSH into the carbon daemon -# and get a python interpreter. BE CAREFUL WITH THIS! If you do -# something like time.sleep() in the interpreter, the whole process -# will sleep! This is *extremely* helpful in debugging, assuming -# you are familiar with the code. If you are not, please don't -# mess with this, you are asking for trouble :) -# -# ENABLE_MANHOLE = False -# MANHOLE_INTERFACE = 127.0.0.1 -# MANHOLE_PORT = 7222 -# MANHOLE_USER = admin -# MANHOLE_PUBLIC_KEY = ssh-rsa AAAAB3NzaC1yc2EAAAABiwAaAIEAoxN0sv/e4eZCPpi3N3KYvyzRaBaMeS2RsOQ/cDuKv11dlNzVeiyc3RFmCv5Rjwn/lQ79y0zyHxw67qLyhQ/kDzINc4cY41ivuQXm2tPmgvexdrBv5nsfEpjs3gLZfJnyvlcVyWK/lId8WUvEWSWHTzsbtmXAF2raJMdgLTbQ8wE= - -# Patterns for all of the metrics this machine will store. Read more at -# http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Bindings -# -# Example: store all sales, linux servers, and utilization metrics -# BIND_PATTERNS = sales.#, servers.linux.#, #.utilization -# -# Example: store everything -# BIND_PATTERNS = # - -# To configure special settings for the carbon-cache instance 'b', uncomment this: -#[cache:b] -#LINE_RECEIVER_PORT = 2103 -#PICKLE_RECEIVER_PORT = 2104 -#CACHE_QUERY_PORT = 7102 -# and any other settings you want to customize, defaults are inherited -# from [carbon] section. -# You can then specify the --instance=b option to manage this instance - - - -[relay] -LINE_RECEIVER_INTERFACE = 0.0.0.0 -LINE_RECEIVER_PORT = 2013 -PICKLE_RECEIVER_INTERFACE = 0.0.0.0 -PICKLE_RECEIVER_PORT = 2014 - -# To use consistent hashing instead of the user defined relay-rules.conf, -# change this to: -# RELAY_METHOD = consistent-hashing -RELAY_METHOD = rules - -# If you use consistent-hashing you may want to add redundancy -# of your data by replicating every datapoint to more than -# one machine. -REPLICATION_FACTOR = 1 - -# This is a list of carbon daemons we will send any relayed or -# generated metrics to. The default provided would send to a single -# carbon-cache instance on the default port. However if you -# use multiple carbon-cache instances then it would look like this: -# -# DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b -# -# The general form is IP:PORT:INSTANCE where the :INSTANCE part is -# optional and refers to the "None" instance if omitted. -# -# Note that if the destinations are all carbon-caches then this should -# exactly match the webapp's CARBONLINK_HOSTS setting in terms of -# instances listed (order matters!). -# -# If using RELAY_METHOD = rules, all destinations used in relay-rules.conf -# must be defined in this list -DESTINATIONS = 127.0.0.1:2004 - -# This defines the maximum "message size" between carbon daemons. -# You shouldn't need to tune this unless you really know what you're doing. -MAX_DATAPOINTS_PER_MESSAGE = 500 -MAX_QUEUE_SIZE = 10000 - -# Set this to False to drop datapoints when any send queue (sending datapoints -# to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the -# default) then sockets over which metrics are received will temporarily stop accepting -# data until the send queues fall below 80% MAX_QUEUE_SIZE. -USE_FLOW_CONTROL = True - -# Set this to True to enable whitelisting and blacklisting of metrics in -# CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or -# empty, all metrics will pass through -# USE_WHITELIST = False - -# By default, carbon itself will log statistics (such as a count, -# metricsReceived) with the top level prefix of 'carbon' at an interval of 60 -# seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation -# CARBON_METRIC_PREFIX = carbon -# CARBON_METRIC_INTERVAL = 60 - - -[aggregator] -LINE_RECEIVER_INTERFACE = 0.0.0.0 -LINE_RECEIVER_PORT = 2023 - -PICKLE_RECEIVER_INTERFACE = 0.0.0.0 -PICKLE_RECEIVER_PORT = 2024 - -# This is a list of carbon daemons we will send any relayed or -# generated metrics to. The default provided would send to a single -# carbon-cache instance on the default port. However if you -# use multiple carbon-cache instances then it would look like this: -# -# DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b -# -# The format is comma-delimited IP:PORT:INSTANCE where the :INSTANCE part is -# optional and refers to the "None" instance if omitted. -# -# Note that if the destinations are all carbon-caches then this should -# exactly match the webapp's CARBONLINK_HOSTS setting in terms of -# instances listed (order matters!). -DESTINATIONS = 127.0.0.1:2004 - -# If you want to add redundancy to your data by replicating every -# datapoint to more than one machine, increase this. -REPLICATION_FACTOR = 1 - -# This is the maximum number of datapoints that can be queued up -# for a single destination. Once this limit is hit, we will -# stop accepting new data if USE_FLOW_CONTROL is True, otherwise -# we will drop any subsequently received datapoints. -MAX_QUEUE_SIZE = 10000 - -# Set this to False to drop datapoints when any send queue (sending datapoints -# to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the -# default) then sockets over which metrics are received will temporarily stop accepting -# data until the send queues fall below 80% MAX_QUEUE_SIZE. -USE_FLOW_CONTROL = True - -# This defines the maximum "message size" between carbon daemons. -# You shouldn't need to tune this unless you really know what you're doing. -MAX_DATAPOINTS_PER_MESSAGE = 500 - -# This defines how many datapoints the aggregator remembers for -# each metric. Aggregation only happens for datapoints that fall in -# the past MAX_AGGREGATION_INTERVALS * intervalSize seconds. -MAX_AGGREGATION_INTERVALS = 5 - -# Set this to True to enable whitelisting and blacklisting of metrics in -# CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or -# empty, all metrics will pass through -# USE_WHITELIST = False - -# By default, carbon itself will log statistics (such as a count, -# metricsReceived) with the top level prefix of 'carbon' at an interval of 60 -# seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation -# CARBON_METRIC_PREFIX = carbon -# CARBON_METRIC_INTERVAL = 60 diff --git a/templates/config.js.erb b/templates/config.js.erb deleted file mode 100644 index d0f2175..0000000 --- a/templates/config.js.erb +++ /dev/null @@ -1,63 +0,0 @@ -/* - -Required Variables: - - port: StatsD listening port [default: 8125] - -Graphite Required Variables: - -(Leave these unset to avoid sending stats to Graphite. - Set debug flag and leave these unset to run in 'dry' debug mode - - useful for testing statsd clients without a Graphite server.) - - graphiteHost: hostname or IP of Graphite server - graphitePort: port of Graphite server - -Optional Variables: - - backends: an array of backends to load. Each backend must exist - by name in the directory backends/. If not specified, - the default graphite backend will be loaded. - debug: debug flag [default: false] - address: address to listen on over UDP [default: 0.0.0.0] - port: port to listen for messages on over UDP [default: 8125] - mgmt_address: address to run the management TCP interface on - [default: 0.0.0.0] - mgmt_port: port to run the management TCP interface on [default: 8126] - debugInterval: interval to print debug information [ms, default: 10000] - dumpMessages: log all incoming messages - flushInterval: interval (in ms) to flush to Graphite - percentThreshold: for time information, calculate the Nth percentile(s) - (can be a single value or list of floating-point values) - [%, default: 90] - keyFlush: log the most frequently sent keys [object, default: undefined] - interval: how often to log frequent keys [ms, default: 0] - percent: percentage of frequent keys to log [%, default: 100] - log: location of log file for frequent keys [default: STDOUT] - - console: - prettyprint: whether to prettyprint the console backend - output [true or false, default: true] - - log: log settings [object, default: undefined] - backend: where to log: stdout or syslog [string, default: stdout] - application: name of the application for syslog [string, default: statsd] - level: log level for [node-]syslog [string, default: LOG_INFO] - - repeater: an array of hashes of the for host: and port: - that details other statsd servers to which the received - packets should be "repeated" (duplicated to). - e.g. [ { host: '10.10.10.10', port: 8125 }, - { host: 'observer', port: 88125 } ] -*/ -{ - graphitePort: 2003 -, graphiteHost: "127.0.0.1" -, port: 8125 -, deleteTimers: true -, deleteCounters: true -<% if @statsd_ipv6_listen -%> -, address: '::' -, address_ipv6: true -<% end -%> -} diff --git a/templates/graphite.ssl.vhost.erb b/templates/graphite.ssl.vhost.erb deleted file mode 100644 index d2b6bba..0000000 --- a/templates/graphite.ssl.vhost.erb +++ /dev/null @@ -1,73 +0,0 @@ - - ErrorLog /var/log/apache2/graphite-error.log - CustomLog /var/log/apache2/graphite-access.log common - LogLevel warn - ServerSignature Off - - Redirect / https://<%= scope.lookupvar("graphite::vhost_name") %>/ - - - - Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" - SSLEngine on - SSLCertificateFile <%= scope.lookupvar("graphite::ssl_cert_file") %> - SSLCertificateKeyFile <%= scope.lookupvar("graphite::ssl_key_file") %> - <% if scope.lookupvar("graphite::ssl_chain_file") != "" %> - SSLCertificateChainFile <%= scope.lookupvar("graphite::ssl_chain_file") %> - <% end %> - SSLProtocol All -SSLv2 -SSLv3 - # Note: this list should ensure ciphers that provide forward secrecy - SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:!AES256:!aNULL:!eNULL:!MD5:!DSS:!PSK:!SRP - SSLHonorCipherOrder on - - DocumentRoot "/var/lib/graphite/webapp" - ErrorLog /var/log/apache2/graphite-error.log - CustomLog /var/log/apache2/graphite-access.log common - - # Add CORS authorization to the header so third-party services can pull - # metrics data via API calls for things like vizualiation dashboards. - Header set Access-Control-Allow-Origin "*" - - # I've found that an equal number of processes & threads tends - # to show the best performance for Graphite (ymmv). - WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 - WSGIProcessGroup graphite - WSGIApplicationGroup %{GLOBAL} - SetEnv GRAPHITE_STORAGE_DIR /var/lib/graphite/storage - WSGIImportScript /etc/graphite/graphite.wsgi process-group=graphite application-group=%{GLOBAL} - - # XXX You will need to create this file! There is a graphite.wsgi.example - # file in this directory that you can safely use, just copy it to graphite.wgsi - WSGIScriptAlias / /etc/graphite/graphite.wsgi - - Alias /content/ /var/lib/graphite/webapp/content/ - - SetHandler None - - - # XXX In order for the django admin site media to work you - # must change @DJANGO_ROOT@ to be the path to your django - # installation, which is probably something like: - # /usr/lib/python2.6/site-packages/django - Alias /media/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/media/" - - SetHandler None - - - # The graphite.wsgi file has to be accessible by apache. It won't - # be visible to clients because of the DocumentRoot though. - - = 2.4> - Require all granted - - - Order deny,allow - Allow from all - - - = 2.4> - - Require all granted - - - diff --git a/templates/graphite.vhost.erb b/templates/graphite.vhost.erb deleted file mode 100644 index dd87b7e..0000000 --- a/templates/graphite.vhost.erb +++ /dev/null @@ -1,69 +0,0 @@ -# This needs to be in your server's config somewhere, probably -# the main httpd.conf -# NameVirtualHost *:80 - -# This line also needs to be in your server's config. -# LoadModule wsgi_module modules/mod_wsgi.so - -# You need to manually edit this file to fit your needs. -# This configuration assumes the default installation prefix -# of /opt/graphite/, if you installed graphite somewhere else -# you will need to change all the occurances of /opt/graphite/ -# in this file to your chosen install location. - -# XXX You need to set this up! -# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix -#WSGISocketPrefix /var/run/apache2/wsgi - - - DocumentRoot "/var/lib/graphite/webapp" - ErrorLog /var/log/apache2/graphite-error.log - CustomLog /var/log/apache2/graphite-access.log common - - # Add CORS authorization to the header so third-party services can pull - # metrics data via API calls for things like vizualiation dashboards. - Header set Access-Control-Allow-Origin "*" - - # I've found that an equal number of processes & threads tends - # to show the best performance for Graphite (ymmv). - WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 - WSGIProcessGroup graphite - WSGIApplicationGroup %{GLOBAL} - SetEnv GRAPHITE_STORAGE_DIR /var/lib/graphite/storage - WSGIImportScript /etc/graphite/graphite.wsgi process-group=graphite application-group=%{GLOBAL} - - # XXX You will need to create this file! There is a graphite.wsgi.example - # file in this directory that you can safely use, just copy it to graphite.wgsi - WSGIScriptAlias / /etc/graphite/graphite.wsgi - - Alias /content/ /var/lib/graphite/webapp/content/ - - SetHandler None - - - # XXX In order for the django admin site media to work you - # must change @DJANGO_ROOT@ to be the path to your django - # installation, which is probably something like: - # /usr/lib/python2.6/site-packages/django - Alias /media/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/media/" - - SetHandler None - - - # The graphite.wsgi file has to be accessible by apache. It won't - # be visible to clients because of the DocumentRoot though. - - = 2.4> - Require all granted - - - Order deny,allow - Allow from all - - - = 2.4> - - Require all granted - - - diff --git a/templates/graphite.wsgi.django17.erb b/templates/graphite.wsgi.django17.erb deleted file mode 100644 index deb24e2..0000000 --- a/templates/graphite.wsgi.django17.erb +++ /dev/null @@ -1,15 +0,0 @@ -import os, sys -sys.path.append('/var/lib/graphite/webapp') -os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings' - -from django.core.wsgi import get_wsgi_application -application = get_wsgi_application() - -# READ THIS -# Initializing the search index can be very expensive, please include -# the WSGIScriptImport directive pointing to this script in your vhost -# config to ensure the index is preloaded before any requests are handed -# to the process. -from graphite.logger import log -log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid()) -import graphite.metrics.search diff --git a/templates/graphite.wsgi.erb b/templates/graphite.wsgi.erb deleted file mode 100644 index 901de68..0000000 --- a/templates/graphite.wsgi.erb +++ /dev/null @@ -1,16 +0,0 @@ -import os, sys -sys.path.append('/var/lib/graphite/webapp') -os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings' - -import django.core.handlers.wsgi - -application = django.core.handlers.wsgi.WSGIHandler() - -# READ THIS -# Initializing the search index can be very expensive, please include -# the WSGIScriptImport directive pointing to this script in your vhost -# config to ensure the index is preloaded before any requests are handed -# to the process. -from graphite.logger import log -log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid()) -import graphite.metrics.search diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb deleted file mode 100644 index 7b1a757..0000000 --- a/templates/local_settings.py.erb +++ /dev/null @@ -1,4 +0,0 @@ -STORAGE_DIR = '/var/lib/graphite/storage/' -CONF_DIR = '/etc/graphite/' -LOG_DIR = '/var/log/graphite/' -TIME_ZONE = 'Etc/UTC' diff --git a/templates/storage-aggregation.conf.erb b/templates/storage-aggregation.conf.erb deleted file mode 100644 index 52969d4..0000000 --- a/templates/storage-aggregation.conf.erb +++ /dev/null @@ -1,24 +0,0 @@ -[min] -pattern = \.min$ -xFilesFactor = 0 -aggregationMethod = min - -[max] -pattern = \.max$ -xFilesFactor = 0 -aggregationMethod = max - -[sum] -pattern = \.count$ -xFilesFactor = 0 -aggregationMethod = sum - -[stats_counts] -pattern = ^stats_counts\..* -xFilesFactor = 0 -aggregationMethod = sum - -[default_average] -pattern = .* -xFilesFactor = 0 -aggregationMethod = average diff --git a/templates/storage-schemas.conf.erb b/templates/storage-schemas.conf.erb deleted file mode 100644 index 68108ae..0000000 --- a/templates/storage-schemas.conf.erb +++ /dev/null @@ -1,15 +0,0 @@ -# Schema definitions for Whisper files. Entries are scanned in order, -# and first match wins. This file is scanned for changes every 60 seconds. -# -# [name] -# pattern = regex -# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... - -# Carbon's internal metrics. This entry should match what is specified in -# CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings -<% @storage_schemas.each do |schema| -%> -["<%= schema['name'] %>"] -pattern = <%= schema['pattern'] %> -retentions = <%= schema['retentions'] %> - -<% end -%>