Add zanata.ini file
The zanata client uses a .ini file to store the server's url and an API key. Manage this file using puppet so we can easily install this configuration. Change-Id: I21c972de4df95b76b0e3361695d74f7d89b1f82c
This commit is contained in:
parent
9aecff6ab3
commit
4515974ae8
@ -18,8 +18,15 @@ class zanata::client(
|
|||||||
$version = '3.4.2',
|
$version = '3.4.2',
|
||||||
$user = 'jenkins',
|
$user = 'jenkins',
|
||||||
$group = 'jenkins',
|
$group = 'jenkins',
|
||||||
|
$server = '',
|
||||||
|
$server_url = '',
|
||||||
|
$server_user = '',
|
||||||
|
$server_api_key = '',
|
||||||
|
$homedir = '/home/jenkins/',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
$serverid = regsubst($server, '\.', '_', 'G')
|
||||||
|
|
||||||
file { '/opt/zanata':
|
file { '/opt/zanata':
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => $user,
|
owner => $user,
|
||||||
@ -69,4 +76,12 @@ class zanata::client(
|
|||||||
package { 'openjdk-7-jre-headless':
|
package { 'openjdk-7-jre-headless':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { "${homedir}/.config/zanata.ini": # XXX needs to be in homedir
|
||||||
|
ensure => present,
|
||||||
|
owner => $user,
|
||||||
|
group => $group,
|
||||||
|
mode => '0600',
|
||||||
|
content => template('zanata/zanata.ini.erb'),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
4
templates/zanata.ini.erb
Normal file
4
templates/zanata.ini.erb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[servers]
|
||||||
|
<%= @serverid -%>.url=<%= @server_url %>
|
||||||
|
<%= @serverid -%>.username=<%= @server_user %>
|
||||||
|
<%= @serverid -%>.key=<%= @server_api_key %>
|
Loading…
Reference in New Issue
Block a user