Skip to content
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.rake_test_cache

dashboard.json
6 changes: 5 additions & 1 deletion cookbooks/nova/recipes/dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
package "apache2"
package "libapache2-mod-wsgi"

execute "bzr branch #{node[:nova][:dashboard][:dashboard_branch]} #{node[:nova][:dashboard][:deploy_dir]}"
if File.directory?(node[:nova][:dashboard][:deploy_dir])
execute "cd #{node[:nova][:dashboard][:deploy_dir]} && bzr pull #{node[:nova][:dashboard][:dashboard_branch]}"
else
execute "bzr branch #{node[:nova][:dashboard][:dashboard_branch]} #{node[:nova][:dashboard][:deploy_dir]}"
end

file "/usr/lib/python2.6/dist-packages/dashboard.pth" do
content node[:nova][:dashboard][:dashboard_dir]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ NOVA_DEFAULT_REGION = '<%=node[:nova][:dashboard][:default_region]%>'
NOVA_ACCESS_KEY = '<%=node[:nova][:access_key]%>'
NOVA_SECRET_KEY = '<%=node[:nova][:secret_key]%>'
NOVA_ADMIN_USER = 'admin'
NOVA_PROJECT = 'admin'
NOVA_PROJECT = '<%=node[:nova][:project]%>'
9 changes: 9 additions & 0 deletions dashboard.json.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"run_list": [ "role[dashboard-server]" ],
"nova": {
"my_ip": "MY_IP",
"access_key": "ACCESS_KEY",
"secret_key": "SECRET_KEY",
"project": "PROJECT"
}
}
8 changes: 8 additions & 0 deletions dashboard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
[[ -z $EC2_ACCESS_KEY ]] && { echo "Error: EC2_ACCESS_KEY, EC2_SECRET_KEY variables must be set."; exit 1; }
ip_resolved=`host \`hostname\``
MY_IP=`echo $ip_resolved | awk '{ print $4 }'`
PRJ=`echo $EC2_ACCESS_KEY | awk -F ':' '{ print $2 }'`
sed "s/MY_IP/$MY_IP/; s/ACCESS_KEY/$EC2_ACCESS_KEY/; \
s/SECRET_KEY/$EC2_SECRET_KEY/; s/PROJECT/$PRJ/" dashboard.json.tmpl > dashboard.json
chef-solo -c chef-solo.rb -j dashboard.json
2 changes: 1 addition & 1 deletion roles/dashboard-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
run_list(
"recipe[apt]",
"recipe[apache2]",
"recipe[apache2::modwsgi]",
"recipe[apache2::mod_wsgi]",
"recipe[nova::dashboard]"
)