Merge "Update OSTF to use ostf.conf instead of params"

This commit is contained in:
Jenkins 2014-04-22 22:28:44 +00:00 committed by Gerrit Code Review
commit 646e52b7a3
3 changed files with 35 additions and 16 deletions

View File

@ -1,16 +1,18 @@
class nailgun::ostf(
$pip_opts,
$production,
$venv = '/opt/fuel_plugins/ostf',
$dbuser = 'ostf',
$dbpass = 'ostf',
$dbname = 'ostf',
$dbhost = '127.0.0.1',
$dbport = '5432',
$dbengine = 'postgresql+psycopg2',
$host = '127.0.0.1',
$port = '8777',
$logfile = '/var/log/ostf.log',
$venv = '/opt/fuel_plugins/ostf',
$dbuser = 'ostf',
$dbpass = 'ostf',
$dbname = 'ostf',
$dbhost = '127.0.0.1',
$dbport = '5432',
$nailgun_host = '127.0.0.1',
$nailgun_port = '8000',
$dbengine = 'postgresql+psycopg2',
$host = '127.0.0.1',
$port = '8777',
$logfile = '/var/log/ostf.log',
){
package{'libevent-devel':}
package{'openssl-devel':}
@ -30,11 +32,10 @@ class nailgun::ostf(
exec {'ostf-init':
command => "/usr/bin/ostf-server \
--host=${host} --port=${port} --log_file=${logfile} \
--dbpath '${dbengine}://${dbuser}:${dbpass}@${dbhost}:${dbport}/${dbname}' \
--after-initialization-environment-hook || /bin/true",
require => [
Package["fuel-ostf"],
File["/etc/ostf/ostf.conf"],
],
before => Class['nailgun::supervisor'],
}
@ -77,10 +78,8 @@ class nailgun::ostf(
nailgun::venv::pip { "${venv}_ostf":
package => 'fuel-ostf',
}
exec {'ostf-init':
exec {'ostf-init2':
command => "$venv/bin/ostf-server \
--host=${host} --port=${port} --log_file=${logfile} \
--dbpath '${dbengine}://${dbuser}:${dbpass}@${dbhost}:${dbport}/${dbname}' \
--after-initialization-environment-hook || /bin/true",
require => [
Postgresql::Db[$dbname],
@ -97,4 +96,15 @@ class nailgun::ostf(
content => template('nailgun/supervisor/ostf.conf.erb'),
require => Package['supervisor'],
}
file { '/etc/ostf/':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0750',
}
file { '/etc/ostf/ostf.conf':
owner => 'root',
group => 'root',
content => template('nailgun/ostf.conf.erb'),
}
}

View File

@ -0,0 +1,9 @@
[adapter]
server_host = <%= @host %>
server_port = <%= @port %>
dbpath = <%= @dbengine %>://<%= @dbuser %>:<%= @dbpass %>@<%= @dbhost %>/<%= @dbname %>
lock_dir = /var/lock
nailgun_host = <%= @nailgun_host %>
nailgun_port = <%= @nailgun_port %>
log_file = <%= @logfile %>
after_init_hook = False

View File

@ -1,5 +1,5 @@
[program:ostf]
command=<%= @ostf_env %>/bin/ostf-server --host=<%= @host %> --port=8777 --log_file=<%= @logfile %> --dbpath <%= @dbengine %>://<%= @dbuser %>:<%= @dbpass %>@<%= @dbhost %>:<%= @dbport %>/<%= @dbname %>
command=/usr/bin/ostf-server
process_name=%(program_name)s
numprocs=1
numprocs_start=0