From 5fb75ec390160c53a8c361b256b36f9c54315d4d Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 27 Jul 2012 09:47:03 -0500 Subject: [PATCH] Add support for puppet dashboard. Change-Id: Ia63c0af6724f95417910215a82abaadd53ba0b49 --- install_modules.sh | 23 ++++++++++++++++++- manifests/site.pp | 7 ++++++ .../openstack_project/manifests/dashboard.pp | 21 +++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 modules/openstack_project/manifests/dashboard.pp diff --git a/install_modules.sh b/install_modules.sh index 658eb10a69..2e93bd3ee4 100644 --- a/install_modules.sh +++ b/install_modules.sh @@ -1,6 +1,6 @@ #!/bin/bash -MODULES="puppetlabs-mysql" +MODULES="puppetlabs-mysql puppetlabs-dashboard" MODULE_LIST=`puppet module list` for MOD in $MODULES ; do @@ -9,3 +9,24 @@ for MOD in $MODULES ; do puppet module install $MOD >/dev/null fi done + +# Fix a problem with the released verison of the dashboard module +if grep scope.lookupvar /etc/puppet/modules/dashboard/templates/passenger-vhost.erb | grep dashboard_port >/dev/null 2>&1 ; then + + cd /etc/puppet/modules/dashboard + echo | patch -p1 <<'EOD' +diff --git a/templates/passenger-vhost.erb b/templates/passenger-vhost.erb +index a2f6d16..de7dd0a 100644 +--- a/templates/passenger-vhost.erb ++++ b/templates/passenger-vhost.erb +@@ -1,6 +1,6 @@ +-Listen <%= scope.lookupvar("dashboard::params::dashboard_port") %> ++Listen <%= dashboard_port %> + +-> ++> + ServerName <%= name %> + DocumentRoot <%= docroot %> + RailsBaseURI <%= rails_base_uri %> +EOD +fi diff --git a/manifests/site.pp b/manifests/site.pp index 89b82e198e..7591bea87b 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -93,6 +93,13 @@ node 'wiki.openstack.org' { include openstack_project::wiki } +node 'puppet-dashboard.openstack.org' { + class { 'openstack_project::dashboard': + password => hiera('dashboard_password'), + mysql_password => hiera('dashboard_mysql_password'), + } +} + # A bare machine, but with a jenkins user node /^.*\.template\.openstack\.org$/ { include openstack_project::slave_template diff --git a/modules/openstack_project/manifests/dashboard.pp b/modules/openstack_project/manifests/dashboard.pp new file mode 100644 index 0000000000..b69abbb832 --- /dev/null +++ b/modules/openstack_project/manifests/dashboard.pp @@ -0,0 +1,21 @@ +class openstack_project::dashboard( + $password, + $mysql_password) { + + class { 'openstack_project::template': + iptables_public_tcp_ports => [80, 443, 3000] + } + + class {'::dashboard': + dashboard_ensure => 'present', + dashboard_user => 'www-data', + dashboard_group => 'www-data', + dashboard_password => $password, + dashboard_db => 'dashboard_prod', + dashboard_charset => 'utf8', + dashboard_site => $fqdn, + dashboard_port => '3000', + mysql_root_pw => $mysql_password, + passenger => true, + } +}