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 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 => [File['/srv/static/status'],
  96. Vcsrepo['/opt/jquery-visibility']],
  97. }
  98. vcsrepo { '/opt/jquery-graphite':
  99. ensure => latest,
  100. provider => git,
  101. revision => 'master',
  102. source => 'https://github.com/prestontimmons/graphitejs.git',
  103. }
  104. file { '/srv/static/status/jquery-graphite.js':
  105. ensure => link,
  106. target => '/opt/jquery-graphite/jquery.graphite.js',
  107. require => [File['/srv/static/status'],
  108. Vcsrepo['/opt/jquery-graphite']],
  109. }
  110. vcsrepo { '/opt/flot':
  111. ensure => latest,
  112. provider => git,
  113. revision => 'master',
  114. source => 'https://github.com/flot/flot.git',
  115. }
  116. exec { 'install_flot' :
  117. command => 'yui-compressor -o \'.js$:.min.js\' /opt/flot/jquery.flot*.js; mv /opt/flot/jquery.flot*.min.js /srv/static/status',
  118. path => '/bin:/usr/bin',
  119. refreshonly => true,
  120. subscribe => Vcsrepo['/opt/flot'],
  121. require => [File['/srv/static/status'],
  122. Vcsrepo['/opt/flot']],
  123. }
  124. ###########################################################
  125. # Status - elastic-recheck
  126. include elastic_recheck
  127. class { 'elastic_recheck::bot':
  128. gerrit_host => $gerrit_host,
  129. gerrit_ssh_host_key => $gerrit_ssh_host_key,
  130. recheck_ssh_public_key => $recheck_ssh_public_key,
  131. recheck_ssh_private_key => $recheck_ssh_private_key,
  132. recheck_bot_passwd => $recheck_bot_passwd,
  133. recheck_bot_nick => $recheck_bot_nick,
  134. }
  135. # sets up the cron update scripts for static pages
  136. include elastic_recheck::cron
  137. ###########################################################
  138. # Status - zuul
  139. file { '/srv/static/status/zuul':
  140. ensure => directory,
  141. }
  142. file { '/srv/static/status/zuul/index.html':
  143. ensure => present,
  144. content => template('openstack_project/zuul/status.html.erb'),
  145. require => File['/srv/static/status/zuul'],
  146. }
  147. file { '/srv/static/status/zuul/status.js':
  148. ensure => present,
  149. content => template('openstack_project/zuul/status.js.erb'),
  150. require => File['/srv/static/status/zuul'],
  151. }
  152. file { '/srv/static/status/zuul/green.png':
  153. ensure => present,
  154. source => 'puppet:///modules/openstack_project/zuul/green.png',
  155. require => File['/srv/static/status/zuul'],
  156. }
  157. file { '/srv/static/status/zuul/red.png':
  158. ensure => present,
  159. source => 'puppet:///modules/openstack_project/zuul/red.png',
  160. require => File['/srv/static/status/zuul'],
  161. }
  162. file { '/srv/static/status/zuul/black.png':
  163. ensure => present,
  164. source => 'puppet:///modules/openstack_project/zuul/black.png',
  165. require => File['/srv/static/status/zuul'],
  166. }
  167. file { '/srv/static/status/zuul/grey.png':
  168. ensure => present,
  169. source => 'puppet:///modules/openstack_project/zuul/grey.png',
  170. require => File['/srv/static/status/zuul'],
  171. }
  172. file { '/srv/static/status/zuul/line-angle.png':
  173. ensure => present,
  174. source => 'puppet:///modules/openstack_project/zuul/line-angle.png',
  175. require => File['/srv/static/status/zuul'],
  176. }
  177. file { '/srv/static/status/zuul/line-t.png':
  178. ensure => present,
  179. source => 'puppet:///modules/openstack_project/zuul/line-t.png',
  180. require => File['/srv/static/status/zuul'],
  181. }
  182. file { '/srv/static/status/zuul/line.png':
  183. ensure => present,
  184. source => 'puppet:///modules/openstack_project/zuul/line.png',
  185. require => File['/srv/static/status/zuul'],
  186. }
  187. ###########################################################
  188. # Status - reviewday
  189. include reviewday
  190. reviewday::site { 'reviewday':
  191. git_url => 'git://git.openstack.org/openstack-infra/reviewday',
  192. serveradmin => 'webmaster@openstack.org',
  193. httproot => '/srv/static/reviewday',
  194. gerrit_url => 'review.openstack.org',
  195. gerrit_port => '29418',
  196. gerrit_user => 'reviewday',
  197. reviewday_gerrit_ssh_key => $gerrit_ssh_host_key,
  198. reviewday_rsa_pubkey_contents => $reviewday_ssh_public_key,
  199. reviewday_rsa_key_contents => $reviewday_ssh_private_key,
  200. }
  201. ###########################################################
  202. # Status - releasestatus (removed)
  203. file { '/srv/static/release':
  204. ensure => absent,
  205. force => yes,
  206. }
  207. file { '/var/lib/releasestatus':
  208. ensure => absent,
  209. force => yes,
  210. }
  211. user { 'releasestatus':
  212. ensure => absent,
  213. }
  214. group { 'releasestatus':
  215. ensure => absent,
  216. }
  217. ###########################################################
  218. # Status - bugdaystats
  219. include bugdaystats
  220. bugdaystats::site { 'bugdaystats':
  221. git_url => 'git://git.openstack.org/openstack-infra/bugdaystats',
  222. serveradmin => 'webmaster@openstack.org',
  223. httproot => '/srv/static/bugdaystats',
  224. configfile => '/var/lib/bugdaystats/config.js',
  225. }
  226. ###########################################################
  227. # Status - openstack-health
  228. include 'openstack_health'
  229. openstack_health::site { 'openstack-health':
  230. httproot => '/srv/static/openstack-health',
  231. api_endpoint => $openstack_health_api_endpoint
  232. }
  233. }