Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use puppetlabs/apache 0.9.x #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
fixtures:
repositories:
apache:
repo: git://github.com/puppetlabs/puppetlabs-apache.git
ref: '0.6.0'
apache: git://github.com/puppetlabs/puppetlabs-apache.git
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
firewall: git://github.com/puppetlabs/puppetlabs-firewall.git
python: git://github.com/footballradar/puppet-python.git
Expand Down
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license 'Apache License, Version 2.0'
summary 'Module to manage the Graphite monitoring tool'
project_page 'https://github.com/garethr/garethr-graphite'

dependency 'puppetlabs/apache', '0.6.0'
dependency 'puppetlabs/apache', '0.9.x'
dependency 'footballradar/python', '0.x'
14 changes: 10 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

$admin_password = $graphite::admin_password
$port = $graphite::port
$servername = $graphite::servername

file { '/etc/init.d/carbon':
ensure => link,
Expand Down Expand Up @@ -62,12 +63,17 @@
require => File['/opt/graphite/storage']
}

apache::mod { 'headers': }
apache::vhost { 'graphite':
include apache
include apache::mod::headers
include apache::mod::python

$docroot = '/opt/graphite/webapp'

apache::vhost { $servername:
priority => '10',
port => $port,
template => 'graphite/virtualhost.conf',
docroot => '/opt/graphite/webapp',
custom_fragment => template('graphite/virtualhost.conf'),
docroot => $docroot,
logroot => '/opt/graphite/storage/log/webapp/',
}

Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
$admin_password = $graphite::params::admin_password,
$port = $graphite::params::port,
$manage_python = $graphite::params::manage_python,
$servername = $graphite::params::servername,
) inherits graphite::params {
class{'graphite::install': } ->
class{'graphite::config': } ~>
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'python-twisted',
'python-django-tagging',
'python-simplejson',
'libapache2-mod-python',
'python-memcache',
'python-pysqlite2',
'python-support',
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class graphite::params {
$admin_password = 'sha1$1b11b$edeb0a67a9622f1f2cfeabf9188a711f5ac7d236'
$port = 80
$servername = 'graphite'
$manage_python = true
}
11 changes: 2 additions & 9 deletions templates/virtualhost.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<VirtualHost *:<%= port %>>
ServerName <%= srvname %>
DocumentRoot <%= docroot %>
ErrorLog <%= logroot %>/<%= name %>_error.log
CustomLog <%= logroot %>/<%= name %>_access.log combined

<Location "/">
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Header set Access-Control-Allow-Headers "origin, authorization, accept"
SetHandler python-program
PythonPath "['<%= docroot %>'] + sys.path"
PythonPath "['<%= @docroot %>'] + sys.path"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell this will not work right. There is a non-trivial chance the @docroot will be undefined at the time this template gets evaluated. Probably because the vhost template itself evaluates the custom fragment template (templates within templates). See this issue for discussion: puppetlabs/puppetlabs-apache#450

PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE <%= srvname %>.settings
SetEnv DJANGO_SETTINGS_MODULE <%= @servername %>.settings

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

PythonDebug Off
PythonAutoReload Off
</Location>
Expand All @@ -25,4 +19,3 @@
</Location>

Alias /media/ /usr/lib/python2.6/site-packages/django/contrib/admin/media/
</VirtualHost>