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.

133 lines
4.4KB

  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_dev
  16. #
  17. class openstack_project::translate_dev(
  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. $project_config_repo = '',
  26. $openid_url = '',
  27. $vhost_name = $::fqdn,
  28. $ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem',
  29. $ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key',
  30. $ssl_chain_file = '',
  31. $ssl_cert_file_contents = '', # If left empty puppet will not create file.
  32. $ssl_key_file_contents = '', # If left empty puppet will not create file.
  33. $ssl_chain_file_contents = '', # If left empty puppet will not create file.
  34. $listeners = [],
  35. $from_address,
  36. ) {
  37. class { 'openstack_project::server': }
  38. class { 'project_config':
  39. url => $project_config_repo,
  40. }
  41. class { '::zanata':
  42. mysql_host => $mysql_host,
  43. mysql_port => $mysql_port,
  44. zanata_db_username => $mysql_user,
  45. zanata_db_password => $mysql_password,
  46. zanata_openid_provider_url => $openid_url,
  47. zanata_listeners => $listeners,
  48. zanata_admin_users => $admin_users,
  49. zanata_default_from_address => $from_address,
  50. zanata_main_version => 4,
  51. zanata_url => 'https://github.com/zanata/zanata-platform/releases/download/platform-4.3.3/zanata-4.3.3-wildfly.zip',
  52. zanata_checksum => 'eaf8bd07401dade758b677007d2358f173193d17',
  53. zanata_wildfly_version => '10.1.0',
  54. zanata_wildfly_install_url => 'https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/10.1.0.Final/wildfly-dist-10.1.0.Final.tar.gz',
  55. require => [
  56. Class['openstack_project::server']
  57. ],
  58. }
  59. class { '::zanata::apache':
  60. vhost_name => $vhost_name,
  61. ssl_cert_file => $ssl_cert_file,
  62. ssl_key_file => $ssl_key_file,
  63. ssl_chain_file => $ssl_chain_file,
  64. ssl_cert_file_contents => $ssl_cert_file_contents,
  65. ssl_key_file_contents => $ssl_key_file_contents,
  66. ssl_chain_file_contents => $ssl_chain_file_contents,
  67. require => Class['::zanata']
  68. }
  69. include logrotate
  70. logrotate::file { 'console.log':
  71. log => '/var/log/wildfly/console.log',
  72. options => [
  73. 'daily',
  74. 'rotate 30',
  75. 'missingok',
  76. 'dateext',
  77. 'copytruncate',
  78. 'compress',
  79. 'delaycompress',
  80. 'notifempty',
  81. 'maxage 30',
  82. ],
  83. require => Service['wildfly'],
  84. }
  85. file { '/home/wildfly/projects.yaml':
  86. ensure => present,
  87. owner => 'wildfly',
  88. group => 'wildfly',
  89. mode => '0444',
  90. source => $::project_config::jeepyb_project_file,
  91. replace => true,
  92. require => User['wildfly'],
  93. }
  94. include jeepyb
  95. exec { 'register-zanata-projects':
  96. command => '/usr/local/bin/register-zanata-projects -v -l /var/log/register-zanata-projects.log',
  97. timeout => 900, # 15 minutes
  98. subscribe => File['/home/wildfly/projects.yaml'],
  99. refreshonly => true,
  100. logoutput => true,
  101. environment => [
  102. "PROJECTS_YAML=/home/wildfly/projects.yaml",
  103. "ZANATA_URL=https://${vhost_name}/",
  104. "ZANATA_USER=${zanata_server_user}",
  105. "ZANATA_KEY=${zanata_server_api_key}",
  106. ],
  107. require => [
  108. File['/home/wildfly/projects.yaml'],
  109. Class['jeepyb'],
  110. ],
  111. }
  112. logrotate::file { 'register-zanata-projects.log':
  113. log => '/var/log/register-zanata-projects.log',
  114. options => [
  115. 'compress',
  116. 'missingok',
  117. 'rotate 30',
  118. 'daily',
  119. 'notifempty',
  120. 'copytruncate',
  121. ],
  122. require => Exec['register-zanata-projects'],
  123. }
  124. }