From a750e4aa5b7777b65fd2a09deb48fc67651543e2 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 11 Dec 2013 12:01:13 -0800 Subject: [PATCH] Add status.openstack.org vm Let's branch status.o.o off from static.o.o into its own machine. For now, keep the extra /static/ in paths to ease the transition (so we can use the same files and templates). We can remove them later if desired. Change-Id: If38197db79b9f6adfcdcf40f10d4797c7df1c620 --- manifests/site.pp | 13 + modules/openstack_project/manifests/status.pp | 226 ++++++++++++++++++ 2 files changed, 239 insertions(+) create mode 100644 modules/openstack_project/manifests/status.pp diff --git a/manifests/site.pp b/manifests/site.pp index 44d01e9730..eecaec0a90 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -398,6 +398,19 @@ node 'static.openstack.org' { } } +# A machine to serve static content. +node 'status.openstack.org' { + class { 'openstack_project::status': + sysadmins => hiera('sysadmins'), + reviewday_rsa_key_contents => hiera('reviewday_rsa_key_contents'), + reviewday_rsa_pubkey_contents => hiera('reviewday_rsa_pubkey_contents'), + reviewday_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'), + releasestatus_prvkey_contents => hiera('releasestatus_rsa_key_contents'), + releasestatus_pubkey_contents => hiera('releasestatus_rsa_pubkey_contents'), + releasestatus_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'), + } +} + node 'nodepool.openstack.org' { class { 'openstack_project::nodepool': mysql_password => hiera('nodepool_mysql_password'), diff --git a/modules/openstack_project/manifests/status.pp b/modules/openstack_project/manifests/status.pp new file mode 100644 index 0000000000..35d0d8e7f7 --- /dev/null +++ b/modules/openstack_project/manifests/status.pp @@ -0,0 +1,226 @@ +# == Class: openstack_project::status +# +class openstack_project::status ( + $sysadmins = [], + $reviewday_gerrit_ssh_key = '', + $reviewday_rsa_pubkey_contents = '', + $reviewday_rsa_key_contents = '', + $releasestatus_prvkey_contents = '', + $releasestatus_pubkey_contents = '', + $releasestatus_gerrit_ssh_key = '', + $er_state_dir = '/var/lib/elastic-recheck', +) { + + class { 'openstack_project::server': + iptables_public_tcp_ports => [22, 80, 443], + sysadmins => $sysadmins, + } + + include openstack_project + class { 'jenkins::jenkinsuser': + ssh_key => $openstack_project::jenkins_ssh_key, + } + + include apache + + a2mod { 'rewrite': + ensure => present, + } + a2mod { 'proxy': + ensure => present, + } + a2mod { 'proxy_http': + ensure => present, + } + + file { '/srv/static': + ensure => directory, + } + + ########################################################### + # Status - Index + + apache::vhost { 'status.openstack.org': + port => 80, + priority => '50', + docroot => '/srv/static/status', + template => 'openstack_project/status.vhost.erb', + require => File['/srv/static/status'], + } + + file { '/srv/static/status': + ensure => directory, + } + + package { 'libjs-jquery': + ensure => present, + } + + package { 'yui-compressor': + ensure => present, + } + + file { '/srv/static/status/index.html': + ensure => present, + source => 'puppet:///modules/openstack_project/status/index.html', + require => File['/srv/static/status'], + } + + file { '/srv/static/status/favicon.ico': + ensure => present, + source => 'puppet:///modules/openstack_project/status/favicon.ico', + require => File['/srv/static/status'], + } + + file { '/srv/static/status/common.js': + ensure => present, + source => 'puppet:///modules/openstack_project/status/common.js', + require => File['/srv/static/status'], + } + + file { '/srv/static/status/jquery.min.js': + ensure => link, + target => '/usr/share/javascript/jquery/jquery.min.js', + require => [File['/srv/static/status'], + Package['libjs-jquery']], + } + + vcsrepo { '/opt/jquery-visibility': + ensure => latest, + provider => git, + revision => 'master', + source => 'https://github.com/mathiasbynens/jquery-visibility.git', + } + + exec { 'install_jquery-visibility' : + command => 'yui-compressor -o /srv/static/status/jquery-visibility.min.js /opt/jquery-visibility/jquery-visibility.js', + path => '/bin:/usr/bin', + refreshonly => true, + subscribe => Vcsrepo['/opt/jquery-visibility'], + require => [File['/srv/static/status'], + Vcsrepo['/opt/jquery-visibility']], + } + + vcsrepo { '/opt/jquery-graphite': + ensure => latest, + provider => git, + revision => 'master', + source => 'https://github.com/prestontimmons/graphitejs.git', + } + + file { '/srv/static/status/jquery-graphite.js': + ensure => link, + target => '/opt/jquery-graphite/jquery.graphite.js', + require => [File['/srv/static/status'], + Vcsrepo['/opt/jquery-graphite']], + } + vcsrepo { '/opt/flot': + ensure => latest, + provider => git, + revision => 'master', + source => 'https://github.com/flot/flot.git', + } + + exec { 'install_flot' : + command => 'yui-compressor -o \'.js$:.min.js\' /opt/flot/jquery.flot*.js; mv /opt/flot/jquery.flot*.min.js /srv/static/status', + path => '/bin:/usr/bin', + refreshonly => true, + subscribe => Vcsrepo['/opt/flot'], + require => [File['/srv/static/status'], + Vcsrepo['/opt/flot']], + } + + ########################################################### + # Status - elastic-recheck + include elastic_recheck + + cron { 'elastic-recheck': + user => 'recheck', + minute => '*/15', + hour => '*', + command => "elastic-recheck-graph /opt/elastic-recheck/queries -o ${er_state_dir}/graph-new.json && mv ${er_state_dir}/graph-new.json ${er_state_dir}/graph.json", + environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + require => Class['elastic_recheck'] + } + + ########################################################### + # Status - zuul + + file { '/srv/static/status/zuul': + ensure => directory, + } + + file { '/srv/static/status/zuul/index.html': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/status.html', + require => File['/srv/static/status/zuul'], + } + + file { '/srv/static/status/zuul/status.js': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/status.js', + require => File['/srv/static/status/zuul'], + } + + file { '/srv/static/status/zuul/green.png': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/green.png', + require => File['/srv/static/status/zuul'], + } + + file { '/srv/static/status/zuul/red.png': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/red.png', + require => File['/srv/static/status/zuul'], + } + + file { '/srv/static/status/zuul/line-angle.png': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/line-angle.png', + require => File['/srv/static/status/zuul'], + } + + file { '/srv/static/status/zuul/line-t.png': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/line-t.png', + require => File['/srv/static/status/zuul'], + } + + file { '/srv/static/status/zuul/line.png': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/line.png', + require => File['/srv/static/status/zuul'], + } + + + ########################################################### + # Status - reviewday + + include reviewday + + reviewday::site { 'reviewday': + git_url => 'git://git.openstack.org/openstack-infra/reviewday', + serveradmin => 'webmaster@openstack.org', + httproot => '/srv/static/reviewday', + gerrit_url => 'review.openstack.org', + gerrit_port => '29418', + gerrit_user => 'reviewday', + reviewday_gerrit_ssh_key => $reviewday_gerrit_ssh_key, + reviewday_rsa_pubkey_contents => $reviewday_rsa_pubkey_contents, + reviewday_rsa_key_contents => $reviewday_rsa_key_contents, + } + + ########################################################### + # Status - releasestatus + + class { 'releasestatus': + releasestatus_prvkey_contents => $releasestatus_prvkey_contents, + releasestatus_pubkey_contents => $releasestatus_pubkey_contents, + releasestatus_gerrit_ssh_key => $releasestatus_gerrit_ssh_key, + } + + releasestatus::site { 'releasestatus': + configfile => 'integrated.yaml', + httproot => '/srv/static/release', + } +}