From 95b1ac0706d0e6f127b78235dd89236053a92efe Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 14 Feb 2014 20:34:24 +0100 Subject: [PATCH] update rbenv type to cdist 3.0 style Signed-off-by: Nico Schottelius --- cdist/conf/type/__rbenv/explorer/homedir | 25 ------------------- cdist/conf/type/__rbenv/man.text | 12 ++++++--- cdist/conf/type/__rbenv/manifest | 14 +++++------ .../conf/type/__rbenv/parameter/default/state | 1 + cdist/conf/type/__rbenv/parameter/required | 1 + 5 files changed, 18 insertions(+), 35 deletions(-) delete mode 100755 cdist/conf/type/__rbenv/explorer/homedir create mode 100644 cdist/conf/type/__rbenv/parameter/default/state create mode 100644 cdist/conf/type/__rbenv/parameter/required diff --git a/cdist/conf/type/__rbenv/explorer/homedir b/cdist/conf/type/__rbenv/explorer/homedir deleted file mode 100755 index 8dc25535..00000000 --- a/cdist/conf/type/__rbenv/explorer/homedir +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# 2012 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Check whether repository exists -# - -user="$__object_id" -su - "$user" -c "pwd -P" diff --git a/cdist/conf/type/__rbenv/man.text b/cdist/conf/type/__rbenv/man.text index bee57f76..c6ed5de2 100644 --- a/cdist/conf/type/__rbenv/man.text +++ b/cdist/conf/type/__rbenv/man.text @@ -19,16 +19,22 @@ OPTIONAL PARAMETERS state:: Either "present" or "absent", defaults to "present" +owner:: + Which user should own the rbenv installation, defaults to root + EXAMPLES -------- -------------------------------------------------------------------------------- # Install rbenv including ruby-build for nico -__rbenv nico +__rbenv /home/nico + +# Install rbenv including ruby-build for nico +__rbenv /home/nico --owner nico # Bastian does not need rbenv anymore, he began to code C99 -__rbenv bastian --state absent +__rbenv /home/bastian --state absent -------------------------------------------------------------------------------- @@ -39,5 +45,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2012 Nico Schottelius. Free use of this software is +Copyright \(C) 2012-2014 Nico Schottelius. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__rbenv/manifest b/cdist/conf/type/__rbenv/manifest index 8f912861..767abdba 100644 --- a/cdist/conf/type/__rbenv/manifest +++ b/cdist/conf/type/__rbenv/manifest @@ -1,6 +1,6 @@ #!/bin/sh # -# 2012 Nico Schottelius (nico-cdist at schottelius.org) +# 2012-2014 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -19,20 +19,20 @@ # # -homedir="$(cat "$__object/explorer/homedir")" -state_should=present -[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")" +homedir="$__object_id" + +state_should="$(cat "$__object/parameter/state")" +owner="$(cat "$__object/parameter/owner")" rbenvdir="$homedir/.rbenv" rubybuilddir="$rbenvdir/plugins/ruby-build" __git "$rbenvdir" \ --source git://github.com/sstephenson/rbenv.git \ - --owner "$__object_id" \ + --owner "$owner" \ --state "$state_should" -#__git "$rubybuilddir" \ require="__git/$rbenvdir" __git "$rubybuilddir" \ --source git://github.com/sstephenson/ruby-build.git \ - --owner "$__object_id" \ + --owner "$owner" \ --state "$state_should" diff --git a/cdist/conf/type/__rbenv/parameter/default/state b/cdist/conf/type/__rbenv/parameter/default/state new file mode 100644 index 00000000..e7f6134f --- /dev/null +++ b/cdist/conf/type/__rbenv/parameter/default/state @@ -0,0 +1 @@ +present diff --git a/cdist/conf/type/__rbenv/parameter/required b/cdist/conf/type/__rbenv/parameter/required new file mode 100644 index 00000000..7ee3bde8 --- /dev/null +++ b/cdist/conf/type/__rbenv/parameter/required @@ -0,0 +1 @@ +owner