Merge branch 'master' of https://github.com/telmich/cdist into bugfix_type__key_value
New functionality for remote __object is neededremotes/origin/feature_files_export
commit
807e2902ea
@ -0,0 +1,49 @@ |
||||
cdist-type__rbenv(7) |
||||
==================== |
||||
Nico Schottelius <nico-cdist--@--schottelius.org> |
||||
|
||||
|
||||
NAME |
||||
---- |
||||
cdist-type__rbenv - Manage rbenv installation |
||||
|
||||
|
||||
DESCRIPTION |
||||
----------- |
||||
This cdist type allows you to manage rbenv installations. |
||||
It also installs ruby-build. |
||||
|
||||
|
||||
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 /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 /home/bastian --state absent |
||||
-------------------------------------------------------------------------------- |
||||
|
||||
|
||||
SEE ALSO |
||||
-------- |
||||
- cdist-type(7) |
||||
|
||||
|
||||
COPYING |
||||
------- |
||||
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). |
@ -0,0 +1,38 @@ |
||||
#!/bin/sh |
||||
# |
||||
# 2012-2014 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/>. |
||||
# |
||||
# |
||||
|
||||
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 "$owner" \ |
||||
--state "$state_should" |
||||
|
||||
require="__git/$rbenvdir" __git "$rubybuilddir" \ |
||||
--source git://github.com/sstephenson/ruby-build.git \ |
||||
--owner "$owner" \ |
||||
--state "$state_should" |
@ -0,0 +1 @@ |
||||
present |
@ -0,0 +1 @@ |
||||
state |
@ -0,0 +1 @@ |
||||
owner |
@ -0,0 +1,27 @@ |
||||
|
||||
Problem shown by using __rbenv: |
||||
|
||||
__rbenv/nicotest |
||||
__git /home/nico/.rbenv |
||||
__package git |
||||
__directory /home/nico/.rbenv |
||||
|
||||
require="__git/home/nico/.rbenv" |
||||
__git /home/nico/.rbenv/plugins/ruby-build |
||||
__package git |
||||
__directory /home/nico/.rbenv/plugins/ruby-build |
||||
|
||||
|
||||
1) if children do NOT automatically depend on their parents requiremnts |
||||
|
||||
__directory /home/nico/.rbenv/plugins/ruby-build fails: |
||||
because __directory /home/nico/.rbenv/plugins is created by |
||||
__git /home/nico/.rbenv, but __directory /home/nico/.rbenv/plugins/ruby-build |
||||
does not depend on __git /home/nico/.rbenv |
||||
|
||||
2) if children DO automatically depend on their parents requiremnts |
||||
__package git from __git /home/nico/.rbenv/plugins/ruby-build depends on __git /home/nico/.rbenv. |
||||
|
||||
__git /home/nico/.rbenv depends on __package git (via autorequire) |
||||
|
||||
=> circular dependency, they depend on each other |
Loading…
Reference in new issue