From 4515974ae873262d9dc5fc2aae22d423018771ff Mon Sep 17 00:00:00 2001 From: stephane Date: Mon, 6 Apr 2015 15:25:34 -0700 Subject: [PATCH] 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 --- manifests/client.pp | 15 +++++++++++++++ templates/zanata.ini.erb | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 templates/zanata.ini.erb diff --git a/manifests/client.pp b/manifests/client.pp index cdfb7f5..9925f69 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -18,8 +18,15 @@ class zanata::client( $version = '3.4.2', $user = 'jenkins', $group = 'jenkins', + $server = '', + $server_url = '', + $server_user = '', + $server_api_key = '', + $homedir = '/home/jenkins/', ) { + $serverid = regsubst($server, '\.', '_', 'G') + file { '/opt/zanata': ensure => directory, owner => $user, @@ -69,4 +76,12 @@ class zanata::client( package { 'openjdk-7-jre-headless': 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'), + } } diff --git a/templates/zanata.ini.erb b/templates/zanata.ini.erb new file mode 100644 index 0000000..ca65567 --- /dev/null +++ b/templates/zanata.ini.erb @@ -0,0 +1,4 @@ +[servers] +<%= @serverid -%>.url=<%= @server_url %> +<%= @serverid -%>.username=<%= @server_user %> +<%= @serverid -%>.key=<%= @server_api_key %>