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.

147 lines
4.7KB

  1. # Copyright 2015 Hewlett-Packard Development Company, L.P.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. #
  15. # == Class: openstack_project::translate
  16. #
  17. class openstack_project::translate(
  18. $mysql_host = 'localhost',
  19. $mysql_port = '3306',
  20. $mysql_user = 'zanata',
  21. $mysql_password,
  22. $admin_users = '',
  23. $zanata_server_user = '',
  24. $zanata_server_api_key = '',
  25. $zanata_wildfly_version = '9.0.1',
  26. $zanata_wildfly_install_url = 'https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/9.0.1.Final/wildfly-dist-9.0.1.Final.tar.gz',
  27. $zanata_url = '',
  28. $zanata_checksum = '',
  29. $zanata_main_version = '',
  30. $project_config_repo = '',
  31. $openid_url = '',
  32. $vhost_name = $::fqdn,
  33. $ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem",
  34. $ssl_key_file = "/etc/ssl/private/${::fqdn}.key",
  35. $ssl_chain_file = '/etc/ssl/certs/intermediate.pem',
  36. $ssl_cert_file_contents = '', # If left empty puppet will not create file.
  37. $ssl_key_file_contents = '', # If left empty puppet will not create file.
  38. $ssl_chain_file_contents = '', # If left empty puppet will not create file.
  39. $listeners = [],
  40. $from_address,
  41. ) {
  42. class { 'project_config':
  43. url => $project_config_repo,
  44. }
  45. class { '::zanata':
  46. mysql_host => $mysql_host,
  47. mysql_port => $mysql_port,
  48. zanata_db_username => $mysql_user,
  49. zanata_db_password => $mysql_password,
  50. zanata_openid_provider_url => $openid_url,
  51. zanata_listeners => $listeners,
  52. zanata_admin_users => $admin_users,
  53. zanata_default_from_address => $from_address,
  54. zanata_wildfly_version => $zanata_wildfly_version,
  55. zanata_wildfly_install_url => $zanata_wildfly_install_url,
  56. zanata_url => $zanata_url,
  57. zanata_checksum => $zanata_checksum,
  58. zanata_main_version => $zanata_main_version
  59. }
  60. class { '::zanata::apache':
  61. vhost_name => $vhost_name,
  62. ssl_cert_file => $ssl_cert_file,
  63. ssl_key_file => $ssl_key_file,
  64. ssl_chain_file => $ssl_chain_file,
  65. ssl_cert_file_contents => $ssl_cert_file_contents,
  66. ssl_key_file_contents => $ssl_key_file_contents,
  67. ssl_chain_file_contents => $ssl_chain_file_contents,
  68. require => Class['::zanata']
  69. }
  70. include logrotate
  71. logrotate::file { 'console.log':
  72. log => '/var/log/wildfly/console.log',
  73. options => [
  74. 'daily',
  75. 'rotate 30',
  76. 'missingok',
  77. 'dateext',
  78. 'copytruncate',
  79. 'compress',
  80. 'delaycompress',
  81. 'notifempty',
  82. 'maxage 30',
  83. ],
  84. require => Service['wildfly'],
  85. }
  86. file { '/home/wildfly/projects.yaml':
  87. ensure => present,
  88. owner => 'wildfly',
  89. group => 'wildfly',
  90. mode => '0444',
  91. source => $::project_config::jeepyb_project_file,
  92. replace => true,
  93. require => User['wildfly'],
  94. }
  95. include jeepyb
  96. exec { 'register-zanata-projects':
  97. command => '/usr/local/bin/register-zanata-projects -v -l /var/log/register-zanata-projects.log',
  98. timeout => 900, # 15 minutes
  99. subscribe => File['/home/wildfly/projects.yaml'],
  100. refreshonly => true,
  101. logoutput => true,
  102. environment => [
  103. "PROJECTS_YAML=/home/wildfly/projects.yaml",
  104. "ZANATA_URL=https://${vhost_name}/",
  105. "ZANATA_USER=${zanata_server_user}",
  106. "ZANATA_KEY=${zanata_server_api_key}",
  107. ],
  108. require => [
  109. File['/home/wildfly/projects.yaml'],
  110. Class['jeepyb'],
  111. ],
  112. }
  113. logrotate::file { 'register-zanata-projects.log':
  114. log => '/var/log/register-zanata-projects.log',
  115. options => [
  116. 'compress',
  117. 'missingok',
  118. 'rotate 30',
  119. 'daily',
  120. 'notifempty',
  121. 'copytruncate',
  122. ],
  123. require => Exec['register-zanata-projects'],
  124. }
  125. mysql_backup::backup_remote { 'translate':
  126. database_host => $mysql_host,
  127. database_user => $mysql_user,
  128. database_password => $mysql_password,
  129. num_backups => '10',
  130. require => Class['zanata'],
  131. }
  132. include bup
  133. bup::site { 'ord.rax':
  134. backup_user => 'bup-translate',
  135. backup_server => 'backup01.ord.rax.ci.openstack.org',
  136. }
  137. }