System configuration for OpenStack Infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

status.pp 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. # == Class: openstack_project::status
  2. #
  3. class openstack_project::status (
  4. $gerrit_host,
  5. $gerrit_ssh_host_key,
  6. $reviewday_ssh_public_key = '',
  7. $reviewday_ssh_private_key = '',
  8. $recheck_ssh_public_key,
  9. $recheck_ssh_private_key,
  10. $recheck_bot_passwd,
  11. $recheck_bot_nick,
  12. $status_base_url = 'http://status.openstack.org',
  13. $status_title = 'OpenStack',
  14. $graphite_render_url = 'http://graphite.openstack.org/render/',
  15. $jenkins_gitfullname = 'OpenStack Jenkins',
  16. $jenkins_gitemail = 'jenkins@openstack.org',
  17. $openstack_health_api_endpoint = 'http://health.openstack.org',
  18. ) {
  19. include openstack_project
  20. class { 'jenkins::jenkinsuser':
  21. ssh_key => $openstack_project::jenkins_ssh_key,
  22. gitfullname => $jenkins_gitfullname,
  23. gitemail => $jenkins_gitemail,
  24. }
  25. include ::httpd
  26. if ! defined(Httpd::Mod['rewrite']) {
  27. httpd::mod { 'rewrite':
  28. ensure => present,
  29. }
  30. }
  31. if ! defined(Httpd::Mod['proxy']) {
  32. httpd::mod { 'proxy':
  33. ensure => present,
  34. }
  35. }
  36. if ! defined(Httpd::Mod['proxy_http']) {
  37. httpd::mod { 'proxy_http':
  38. ensure => present,
  39. }
  40. }
  41. file { '/srv/static':
  42. ensure => directory,
  43. }
  44. ###########################################################
  45. # Status - Index
  46. ::httpd::vhost { 'status.openstack.org':
  47. port => 80,
  48. priority => '50',
  49. docroot => '/srv/static/status',
  50. template => 'openstack_project/status.vhost.erb',
  51. require => File['/srv/static/status'],
  52. }
  53. file { '/srv/static/status':
  54. ensure => directory,
  55. }
  56. package { 'libjs-jquery':
  57. ensure => present,
  58. }
  59. package { 'yui-compressor':
  60. ensure => present,
  61. }
  62. file { '/srv/static/status/index.html':
  63. ensure => present,
  64. source => 'puppet:///modules/openstack_project/status/index.html',
  65. require => File['/srv/static/status'],
  66. }
  67. file { '/srv/static/status/favicon.ico':
  68. ensure => present,
  69. source => 'puppet:///modules/openstack_project/status/favicon.ico',
  70. require => File['/srv/static/status'],
  71. }
  72. file { '/srv/static/status/common.js':
  73. ensure => present,
  74. content => template('openstack_project/status/common.js.erb'),
  75. require => File['/srv/static/status'],
  76. replace => true,
  77. }
  78. file { '/srv/static/status/jquery.min.js':
  79. ensure => link,
  80. target => '/usr/share/javascript/jquery/jquery.min.js',
  81. require => [File['/srv/static/status'],
  82. Package['libjs-jquery']],
  83. }
  84. vcsrepo { '/opt/jquery-visibility':
  85. ensure => latest,
  86. provider => git,
  87. revision => 'master',
  88. source => 'https://github.com/mathiasbynens/jquery-visibility.git',
  89. }
  90. exec { 'install_jquery-visibility' :
  91. command => 'yui-compressor -o /srv/static/status/jquery-visibility.min.js /opt/jquery-visibility/jquery-visibility.js',
  92. path => '/bin:/usr/bin',
  93. refreshonly => true,
  94. subscribe => Vcsrepo['/opt/jquery-visibility'],
  95. require => [
  96. File['/srv/static/status'],
  97. Package['yui-compressor'],
  98. Vcsrepo['/opt/jquery-visibility'],
  99. ],
  100. }
  101. vcsrepo { '/opt/jquery-graphite':
  102. ensure => latest,
  103. provider => git,
  104. revision => 'master',
  105. source => 'https://github.com/prestontimmons/graphitejs.git',
  106. }
  107. file { '/srv/static/status/jquery-graphite.js':
  108. ensure => link,
  109. target => '/opt/jquery-graphite/jquery.graphite.js',
  110. require => [File['/srv/static/status'],
  111. Vcsrepo['/opt/jquery-graphite']],
  112. }
  113. vcsrepo { '/opt/flot':
  114. ensure => latest,
  115. provider => git,
  116. revision => 'master',
  117. source => 'https://github.com/flot/flot.git',
  118. }
  119. exec { 'install_flot' :
  120. command => 'yui-compressor -o \'.js$:.min.js\' /opt/flot/jquery.flot*.js; mv /opt/flot/jquery.flot*.min.js /srv/static/status',
  121. path => '/bin:/usr/bin',
  122. refreshonly => true,
  123. subscribe => Vcsrepo['/opt/flot'],
  124. require => [
  125. File['/srv/static/status'],
  126. Package['yui-compressor'],
  127. Vcsrepo['/opt/flot'],
  128. ],
  129. }
  130. ###########################################################
  131. # Status - elastic-recheck
  132. include elastic_recheck
  133. class { 'elastic_recheck::bot':
  134. gerrit_host => $gerrit_host,
  135. gerrit_ssh_host_key => $gerrit_ssh_host_key,
  136. recheck_ssh_public_key => $recheck_ssh_public_key,
  137. recheck_ssh_private_key => $recheck_ssh_private_key,
  138. recheck_bot_passwd => $recheck_bot_passwd,
  139. recheck_bot_nick => $recheck_bot_nick,
  140. }
  141. # sets up the cron update scripts for static pages
  142. include elastic_recheck::cron
  143. ###########################################################
  144. # Status - reviewday
  145. include reviewday
  146. reviewday::site { 'reviewday':
  147. git_url => 'https://opendev.org/openstack/reviewday',
  148. serveradmin => 'webmaster@openstack.org',
  149. httproot => '/srv/static/reviewday',
  150. gerrit_url => 'review.openstack.org',
  151. gerrit_port => '29418',
  152. gerrit_user => 'reviewday',
  153. reviewday_gerrit_ssh_key => $gerrit_ssh_host_key,
  154. reviewday_rsa_pubkey_contents => $reviewday_ssh_public_key,
  155. reviewday_rsa_key_contents => $reviewday_ssh_private_key,
  156. }
  157. ###########################################################
  158. # Status - bugdaystats
  159. include bugdaystats
  160. bugdaystats::site { 'bugdaystats':
  161. git_url => 'https://opendev.org/openstack/bugdaystats',
  162. serveradmin => 'webmaster@openstack.org',
  163. httproot => '/srv/static/bugdaystats',
  164. configfile => '/var/lib/bugdaystats/config.js',
  165. }
  166. ###########################################################
  167. # Status - openstack-health
  168. include 'openstack_health'
  169. openstack_health::site { 'openstack-health':
  170. httproot => '/srv/static/openstack-health',
  171. api_endpoint => $openstack_health_api_endpoint
  172. }
  173. }