diff --git a/manifests/site.pp b/manifests/site.pp index 77a267d0a7..7eb8ce13f3 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -903,6 +903,9 @@ node 'translate-dev.openstack.org' { from_address => 'noreply@openstack.org', mysql_host => hiera('translate_dev_mysql_host', 'localhost'), mysql_password => hiera('translate_dev_mysql_password', 'XXX'), + zanata_server_user => hiera('proposal_zanata_user', 'XXX'), + zanata_server_api_key => hiera('proposal_zanata_api_key', 'XXX'), + project_config_repo => 'https://git.openstack.org/openstack-infra/project-config', } } diff --git a/modules/openstack_project/manifests/translate_dev.pp b/modules/openstack_project/manifests/translate_dev.pp index ba3aab8afb..a115a7c635 100644 --- a/modules/openstack_project/manifests/translate_dev.pp +++ b/modules/openstack_project/manifests/translate_dev.pp @@ -21,6 +21,9 @@ class openstack_project::translate_dev( $mysql_password, $admin_users = '', $sysadmins = [], + $zanata_server_user = '', + $zanata_server_api_key = '', + $project_config_repo = '', $openid_url = '', $vhost_name = $::fqdn, $ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem', @@ -38,6 +41,10 @@ class openstack_project::translate_dev( iptables_public_tcp_ports => [80, 443], } + class { 'project_config': + url => $project_config_repo, + } + class { '::zanata': mysql_host => $mysql_host, mysql_port => $mysql_port, @@ -79,4 +86,46 @@ class openstack_project::translate_dev( ], require => Service['wildfly'], } + + file { '/home/wildfly/projects.yaml': + ensure => present, + owner => 'wildfly', + group => 'wildfly', + mode => '0444', + source => $::project_config::jeepyb_project_file, + replace => true, + require => User['wildfly'], + } + + include jeepyb + exec { 'register-zanata-projects': + command => '/usr/local/bin/register-zanata-projects >> /var/log/register-zanata-projects.log 2>&1', + timeout => 900, # 15 minutes + subscribe => File['/home/wildfly/projects.yaml'], + refreshonly => true, + logoutput => true, + environment => [ + "PROJECTS_YAML=/home/wildfly/projects.yaml", + "ZANATA_URL=https://${vhost_name}/", + "ZANATA_USER=${zanata_server_user}", + "ZANATA_KEY=${zanata_server_api_key}", + ], + require => [ + File['/home/wildfly/projects.yaml'], + Class['jeepyb'], + ], + } + + logrotate::file { 'register-zanata-projects.log': + log => '/var/log/register-zanata-projects.log', + options => [ + 'compress', + 'missingok', + 'rotate 30', + 'daily', + 'notifempty', + 'copytruncate', + ], + require => Exec['register-zanata-projects'], + } }