Merge "Update OSTF to use ostf.conf instead of params"
This commit is contained in:
commit
646e52b7a3
@ -1,16 +1,18 @@
|
|||||||
class nailgun::ostf(
|
class nailgun::ostf(
|
||||||
$pip_opts,
|
$pip_opts,
|
||||||
$production,
|
$production,
|
||||||
$venv = '/opt/fuel_plugins/ostf',
|
$venv = '/opt/fuel_plugins/ostf',
|
||||||
$dbuser = 'ostf',
|
$dbuser = 'ostf',
|
||||||
$dbpass = 'ostf',
|
$dbpass = 'ostf',
|
||||||
$dbname = 'ostf',
|
$dbname = 'ostf',
|
||||||
$dbhost = '127.0.0.1',
|
$dbhost = '127.0.0.1',
|
||||||
$dbport = '5432',
|
$dbport = '5432',
|
||||||
$dbengine = 'postgresql+psycopg2',
|
$nailgun_host = '127.0.0.1',
|
||||||
$host = '127.0.0.1',
|
$nailgun_port = '8000',
|
||||||
$port = '8777',
|
$dbengine = 'postgresql+psycopg2',
|
||||||
$logfile = '/var/log/ostf.log',
|
$host = '127.0.0.1',
|
||||||
|
$port = '8777',
|
||||||
|
$logfile = '/var/log/ostf.log',
|
||||||
){
|
){
|
||||||
package{'libevent-devel':}
|
package{'libevent-devel':}
|
||||||
package{'openssl-devel':}
|
package{'openssl-devel':}
|
||||||
@ -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'),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
9
deployment/puppet/nailgun/templates/ostf.conf.erb
Normal file
9
deployment/puppet/nailgun/templates/ostf.conf.erb
Normal 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
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user