update rbenv type to cdist 3.0 style
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
490bad7b26
commit
95b1ac0706
5 changed files with 18 additions and 35 deletions
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
# Check whether repository exists
|
||||
#
|
||||
|
||||
user="$__object_id"
|
||||
su - "$user" -c "pwd -P"
|
|
@ -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).
|
||||
|
|
|
@ -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"
|
||||
|
|
1
cdist/conf/type/__rbenv/parameter/default/state
Normal file
1
cdist/conf/type/__rbenv/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
|||
present
|
1
cdist/conf/type/__rbenv/parameter/required
Normal file
1
cdist/conf/type/__rbenv/parameter/required
Normal file
|
@ -0,0 +1 @@
|
|||
owner
|
Loading…
Reference in a new issue