Call register-zanata-projects on translate-dev

To allow us to register projects in Zanata automatically, pull in
jeepyb, and subscribe to the projects.yaml file to run it when it
changes.

This makes use of the wildfly user and home directory as a useful
place to copy and subscribe to the projects.yaml file.

Change-Id: I25bd20a38315819b79049dd947ada40029a92163
Depends-On: Id0229864b64ce39c70b559e1eb5d94822f1988ec
Depends-On: Id78a590ea07b886afc0c98e309ff6df45f2240bf
This commit is contained in:
Steve Kowalik 2015-08-04 14:05:32 +10:00
parent e589d9b11e
commit 3dc7068020
2 changed files with 52 additions and 0 deletions

View File

@ -882,6 +882,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',
}
}

View File

@ -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'],
}
}