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

@ -7,6 +7,8 @@ class nailgun::ostf(
$dbname = 'ostf', $dbname = 'ostf',
$dbhost = '127.0.0.1', $dbhost = '127.0.0.1',
$dbport = '5432', $dbport = '5432',
$nailgun_host = '127.0.0.1',
$nailgun_port = '8000',
$dbengine = 'postgresql+psycopg2', $dbengine = 'postgresql+psycopg2',
$host = '127.0.0.1', $host = '127.0.0.1',
$port = '8777', $port = '8777',
@ -30,11 +32,10 @@ class nailgun::ostf(
exec {'ostf-init': exec {'ostf-init':
command => "/usr/bin/ostf-server \ 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", --after-initialization-environment-hook || /bin/true",
require => [ require => [
Package["fuel-ostf"], Package["fuel-ostf"],
File["/etc/ostf/ostf.conf"],
], ],
before => Class['nailgun::supervisor'], before => Class['nailgun::supervisor'],
} }
@ -77,10 +78,8 @@ class nailgun::ostf(
nailgun::venv::pip { "${venv}_ostf": nailgun::venv::pip { "${venv}_ostf":
package => 'fuel-ostf', package => 'fuel-ostf',
} }
exec {'ostf-init': exec {'ostf-init2':
command => "$venv/bin/ostf-server \ 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", --after-initialization-environment-hook || /bin/true",
require => [ require => [
Postgresql::Db[$dbname], Postgresql::Db[$dbname],
@ -97,4 +96,15 @@ class nailgun::ostf(
content => template('nailgun/supervisor/ostf.conf.erb'), content => template('nailgun/supervisor/ostf.conf.erb'),
require => Package['supervisor'], 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] [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 process_name=%(program_name)s
numprocs=1 numprocs=1
numprocs_start=0 numprocs_start=0