Skip to content

Commit

Permalink
Fix the base_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Bobkevic committed Dec 1, 2014
1 parent 72ab532 commit b87ff75
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
11 changes: 9 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@
$url,
$private_token,
$ssl_verify = true,
$timeout = 5
$timeout = 5,
$is_base_path = false
) {

file { "$path/.python-gitlab.cfg":
if $is_base_path {
$cfg_path = "${path}/${name}"
} else {
$cfg_path = $path
}

file { "${cfg_path}/.python-gitlab.cfg":
owner => $name,
mode => 0400,
content => template("${module_name}/python-gitlab.cfg.erb"),
Expand Down
12 changes: 11 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#
class gitlab_cli(
$base_path = $::gitlab_cli::params::base_path,
$path = $::gitlab_cli::params::path,
$owner = $::gitlab_cli::params::owner,
$url = $::gitlab_cli::params::url,
$private_token = $::gitlab_cli::params::private_token,
Expand All @@ -46,11 +47,20 @@

python::pip { 'python-gitlab' : } ->
gitlab_cli::config { $owner:
path => "${base_path}/${name}",
url => $url,
private_token => $private_token,
ssl_verify => $ssl_verify,
timeout => $timeout
}

if $base_path != 'UNDEF' {
Gitlab_cli::Config[$owner] {
path => $base_path,
is_base_path => true
}
} else {
Gitlab_cli::Config[$owner] {
path => $path
}
}
}
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
# Copyright 2014 North Development AB
#
class gitlab_cli::params {
$base_path = 'UNDEF'
$path = '/root'
$user = 'root'
$private_token = 'XXXX'
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unibet-gitlab_cli",
"version": "0.2.0",
"version": "0.2.1",
"author": "unibet",
"summary": "Install and configure python-gitlab cli",
"license": "Apache 2.0",
Expand Down

0 comments on commit b87ff75

Please sign in to comment.