Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set default graphite root password

  • Loading branch information...
commit efa8448b786f01c02b4393778157ee0381274ea5 1 parent 2341bf9
@dje dje authored
Showing with 29 additions and 8 deletions.
  1. +29 −8 recipes/web.rb
View
37 recipes/web.rb
@@ -1,26 +1,28 @@
include_recipe "apache2::mod_python"
+version = node[:graphite][:version]
+
package "python-cairo-dev"
package "python-django"
package "python-django-tagging"
package "python-memcache"
package "python-rrdtool"
-remote_file "/usr/src/graphite-web-#{node.graphite.version}.tar.gz" do
- source node.graphite.graphite_web.uri
- checksum node.graphite.graphite_web.checksum
+remote_file "/usr/src/graphite-web-#{version}.tar.gz" do
+ source node[:graphite][:graphite_web][:uri]
+ checksum node[:graphite][:graphite_web][:checksum]
end
execute "untar graphite-web" do
- command "tar xzf graphite-web-#{node.graphite.version}.tar.gz"
- creates "/usr/src/graphite-web-#{node.graphite.version}"
+ command "tar xzf graphite-web-#{version}.tar.gz"
+ creates "/usr/src/graphite-web-#{version}"
cwd "/usr/src"
end
execute "install graphite-web" do
command "python setup.py install"
- creates "/opt/graphite/webapp/graphite_web-#{node.graphite.version}-py2.6.egg-info"
- cwd "/usr/src/graphite-web-#{node.graphite.version}"
+ creates "/opt/graphite/webapp/graphite_web-#{version}-py2.6.egg-info"
+ cwd "/usr/src/graphite-web-#{version}"
end
template "/etc/apache2/sites-available/graphite" do
@@ -33,6 +35,11 @@
apache_site "graphite"
+directory "/opt/graphite/storage/log" do
+ owner "www-data"
+ group "www-data"
+end
+
directory "/opt/graphite/storage/log/webapp" do
owner "www-data"
group "www-data"
@@ -43,8 +50,22 @@
group "www-data"
end
+cookbook_file "/opt/graphite/bin/set_admin_passwd.py" do
+ mode "755"
+end
+
cookbook_file "/opt/graphite/storage/graphite.db" do
+ action :create_if_missing
+ notifies :run, "execute[set admin password]"
+end
+
+execute "set admin password" do
+ command "/opt/graphite/bin/set_admin_passwd.py root #{node[:graphite][:password]}"
+ action :nothing
+end
+
+file "/opt/graphite/storage/graphite.db" do
owner "www-data"
group "www-data"
- action :create_if_missing
+ mode "644"
end
Please sign in to comment.
Something went wrong with that request. Please try again.